#include "stdafx.h"
#include "actual_testing.h"

//Messages
#define _ERROR_WRONG_CHARACTER_INDEX "STUDENT ERROR: Wrong (%d while %s %d expected) character index %s returned from function %s\n"
#define _ERROR_NO_END_OF_STRING "STUDENT ERROR: No end of string on argument %s returned from function %s\n"
#define _ERROR_WRONG_ARGUMENT_NAME "INPUT ERROR: wrong argument name %s instead of %s in function %s\n"
#define _ERROR_WRONG_ARRAY_SIZE "STUDENT ERROR: Wrong (%d while %s %d expected) array size in array %s returned from function %s\n"
#define _ERROR_POINTER_MISS_STRING "STUDENT ERROR: Pointer %s returned from the function %s miss string %s\n"
#define _ERROR_WRONG_RETURN_VALUE "STUDENT ERROR: Wrong (%d while %s %d expected) value %s from function %s\n"
#define _ERROR_WRONG_RETURN_ARG "STUDENT ERROR: Wrong (%d while %s %d expected) value returned in argument %s from function %s\n"
#define _ERROR_NUMBER_LIMITS "%s should be between %s and %s\n"

int _wrong_strcat_strcpy=0;

#define GUARD_CALL(expr) \
	GUARD(expr, return TESTRES_FATAL_ERROR_EXECUTING_TEST_FUNCTION;);\
	if(_wrong_strcat_strcpy)\
	{\
		_wrong_strcat_strcpy=0;\
		return TESTRES_WRONG_STRCAT_STRCPY_USE;\
	}\
	if(__stub_called) \
		return TESTRES_STUB_CALLED;


//Internal macros
#define CHECK_ARG_NAME(argname,funcname) \
	{\
		char _buffer[300];\
		read_string_raw(_buffer,300,istream);\
		if(strcmp(_buffer+6/*omitting [in]<<*/,argname))\
		{\
			fprintf(ostream,_ERROR_WRONG_ARGUMENT_NAME,_buffer,argname,funcname);\
			return TESTRES_WRONG_INPUT_DATA;\
		}\
	}
//Internal macros for checking data integrity
#define CHECK_INT_HIGH_LIMIT(var,limit,format,argname,funcname,lowname,highname) \
	if(var>limit)\
	{\
		fprintf(ostream,format,var,"<=",limit,argname,funcname);\
		fprintf(ostream,_ERROR_NUMBER_LIMITS,argname,lowname,highname);\
		return TESTRES_WRONG_VALUES_RETURNED;\
	}

#define CHECK_INT_LOW_LIMIT(var,limit,format,argname,funcname,lowname,highname) \
	if(var<limit)\
	{\
		fprintf(ostream,format,var,">=",limit,argname,funcname);\
		fprintf(ostream,_ERROR_NUMBER_LIMITS,argname,lowname,highname);\
		return TESTRES_WRONG_VALUES_RETURNED;\
	}

#define CHECK_INT_LIMITS(var,lowlimit,highlimit,format,argname,funcname,lowname,highname) \
	CHECK_INT_LOW_LIMIT(var,lowlimit,format,argname,funcname,lowname,highname)\
	CHECK_INT_HIGH_LIMIT(var,highlimit,format,argname,funcname,lowname,highname)

#define CHECK_INT_ARRAY_LIMITS(arr,size,lowlimit,highlimit,argname,funcname,lowname,highname) \
	{\
		int _i; char _tmp[40];\
		for(_i=0;_i<size;_i++)\
		{\
			sprintf(_tmp,"%s[%d]",argname,_i);\
			CHECK_INT_LIMITS(arr[_i],lowlimit,highlimit,_ERROR_WRONG_RETURN_ARG,_tmp,funcname,lowname,highname);\
		}\
	}

#define ENSURE_END_OF_STRING(string,size,argname,funcname) \
	{/*block needed to localize _i, to allow several macros in one function*/\
		int _i;\
		for(_i=0;_i<size && string[_i]!=0;_i++);\
		if(_i==size)\
		{\
			fprintf(ostream,_ERROR_NO_END_OF_STRING,argname,funcname);\
			return TESTRES_WRONG_VALUES_RETURNED;\
		}\
	}
# define ENSURE_END_OF_STRING_IN_TEXT(arr,size1,size2,realsize,argname,funcname) \
	{\
		int __i; char _tmp[40];\
		for(__i=0;__i<realsize;__i++)\
		{\
			sprintf(_tmp,"%s[%d]",argname,__i);\
			ENSURE_END_OF_STRING(arr[__i],size2,_tmp,funcname);\
		}\
	}	

#define ENSURE_POINTER_IN_STRING(string,ptr,argnameString,argnamePtr,funcname) \
	{\
		if(ptr<string || ptr>string+strlen(string))\
		{\
			fprintf(ostream,_ERROR_POINTER_MISS_STRING,argnamePtr, funcname, argnameString);\
			return TESTRES_WRONG_VALUES_RETURNED;\
		}\
	}

#define ENSURE_POINTER_IN_STRING_OR_NULL(string,ptr,argnameString,argnamePtr,funcname) \
	{\
		if(ptr!=NULL && (ptr<string || ptr>string+strlen(string)))\
		{\
			fprintf(ostream,_ERROR_POINTER_MISS_STRING,argnamePtr, funcname, argnameString);\
			return TESTRES_WRONG_VALUES_RETURNED;\
		}\
	}

#define WPTR2_FROM_PTR_AND_LEN(wps,size1,size2,text,strCount,wpscount,words,wordLength) \
	{\
		bool _ptrerror=false;\
		int ___i;\
		for(___i=0;___i<wpscount && !_ptrerror;___i++)\
		{\
			if(!wps[___i].extractFromPtrAndLen<size1,size2>(text,strCount,words[___i],wordLength[___i]))\
			{\
				fprintf(ostream,"STUDENT %s",wordPointer::err_desc[wps[___i].error]);\
				_ptrerror=true;\
			}\
		}\
		if(_ptrerror)\
		{\
			return TESTRES_WRONG_VALUES_RETURNED;\
		}\
	}

#define WPTR1_FROM_PTR_AND_LEN(wps,str,wpscount,words,wordLength) \
	{\
		bool _ptrerror=false;\
		int ___i;\
		for(___i=0;___i<wpscount && !_ptrerror;___i++)\
		{\
			if(!wps[___i].extractFromPtrAndLen(str,words[___i],wordLength[___i]))\
			{\
				fprintf(ostream,"STUDENT %s",wordPointer::err_desc[wps[___i].error]);\
				_ptrerror=true;\
			}\
		}\
		if(_ptrerror)\
		{\
			return TESTRES_WRONG_VALUES_RETURNED;\
		}\
	}

#define WPTR1_FROM_PTR_PAIR(wps,str,wpscount,ptrs) \
	{\
		bool _ptrerror=false;\
		int ___i;\
		for(___i=0;___i<wpscount && !_ptrerror;___i++)\
		{\
			if(!wps[___i].extractFromPairOfPtrs(str,ptrs[___i][0],ptrs[___i][1]))\
			{\
				fprintf(ostream,"STUDENT %s",wordPointer::err_desc[wps[___i].error]);\
				_ptrerror=true;\
			}\
		}\
		if(_ptrerror)\
		{\
			return TESTRES_WRONG_VALUES_RETURNED;\
		}\
	}
#define WPTR1_FROM_INDX_PAIR(wps,str,wpscount,indxs) \
	{\
		bool _ptrerror=false;\
		int ___i;\
		for(___i=0;___i<wpscount && !_ptrerror;___i++)\
		{\
			if(!wps[___i].extractFromPairOfPtrs(str,str+indxs[___i][0],str+indxs[___i][1]))\
			{\
				fprintf(ostream,"STUDENT %s",wordPointer::err_desc[wps[___i].error]);\
				_ptrerror=true;\
			}\
		}\
		if(_ptrerror)\
		{\
			return TESTRES_WRONG_VALUES_RETURNED;\
		}\
	}

#define CHECK_LOCATION_IN2D(text,strCount,location,argname0,argname1,funcname,minvalue) \
	CHECK_INT_LIMITS(location[0],minvalue,strCount,_ERROR_WRONG_CHARACTER_INDEX,argname0,funcname, "0", "count of strings");\
	CHECK_INT_LIMITS(location[1],minvalue,strlen(text[location[0]]),_ERROR_WRONG_CHARACTER_INDEX,argname1,funcname, "0", "string length");

#define CHECK_LOCATIONS_IN2D(text,strCount,location,locCount,argname,funcname,minvalue) \
	{\
		int ____i;\
		char _tmp0[50],_tmp1[50];\
		for(____i=0;____i<locCount;____i++)\
		{\
			sprintf(_tmp0,"%s[%d][0]",argname,____i);\
			sprintf(_tmp1,"%s[%d][1]",argname,____i);\
			CHECK_LOCATION_IN2D(text,strCount,location[____i],_tmp0,_tmp1,funcname,minvalue)\
		}\
	}


//////////////////////////////////////////////////Actual testing routines/////////////////////////////////////////
	
	//input data
	//execute test
	//check results for integrity
	//output results

//////////////////////////////Variant 1///////////////////////////////////////////////////////////////////////////
int _test_1_selectWords(FILE *istream, FILE *ostream)
{
	char str[1621];
	int min,max;
	char words[30][21];
	int result;
	//input data
	//str
	CHECK_ARG_NAME("str","selectWords");
	readString(istream,str,1621);
	//min,max
	CHECK_ARG_NAME("min","selectWords");
	min=readInt(istream);
	CHECK_ARG_NAME("max","selectWords");
	max=readInt(istream);
	
	//execute test
	GUARD_CALL(result=_1_selectWords(str,min,max,words))
		
	//check results for integrity
	CHECK_INT_LIMITS(result,0,30,_ERROR_WRONG_ARRAY_SIZE,"words","selectWords","0","30");
	ENSURE_END_OF_STRING_IN_TEXT(words,30,21,result,"words","selectWords");
	//output results
	writeOutArg(ostream,"words");
	writeChar2D<30,21>(ostream,words,result);
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_1_findWord(FILE *istream, FILE *ostream)
{
	char str[1621];
	int start,begin,end;
	//actual size of str depends on report of 1'st variant: 0 and 8 - 80 characters, 6 and 7 - 1620 characters
	char *tmpstr=getenv("reportnumber");
	int report=atoi(tmpstr);
	int str_size=80;
	if(report==6 || report==7)
		str_size=1620;
	//input data
	//str
	CHECK_ARG_NAME("str","findWord");
	readString(istream,str,str_size);
	//start
	CHECK_ARG_NAME("start","findWord");
	start=readInt(istream);
	
	//execute test
	GUARD_CALL(_1_findWord(str,start,&begin,&end))

	//check results for integrity
	CHECK_INT_LIMITS(begin,-1,end,_ERROR_WRONG_RETURN_VALUE,"begin","findWord","-1","end");
	CHECK_INT_LIMITS(end,begin,str_size,_ERROR_WRONG_RETURN_VALUE,"end","findWord","begin","string length");
	//output results
	writeOutArg(ostream, wordPointer1D::arg_title);
	if(begin==-1 && end==-1)
	{
		writeString(ostream,"word not found");
	}
	else
	{
		wordPointer1D wptr;
		if(!wptr.extractFromPairOfPtrs(str,str+begin,str+end))
		{
			fprintf(ostream,"STUDENT %s",wordPointer::err_desc[wptr.error]);
			return TESTRES_WRONG_VALUES_RETURNED;
		}
		wptr.write(ostream);
	}
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
///////variant 1 mod 6
int _test_530ec_textToStr(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int strCount;
	char str[1621];
	//input data
	//text
	CHECK_ARG_NAME("text","textToStr");
	readChar2D<20,81>(istream,text);
	//strCount
	CHECK_ARG_NAME("strCount","textToStr");
	strCount=readInt(istream);

	//execute test
	GUARD_CALL(_530ec_textToStr(text,strCount,str))

	//check results for integrity
	ENSURE_END_OF_STRING(str,1621,"str","textToStr");
	//output results
	writeOutArg(ostream, "str");
	writeString(ostream, str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
///////variant 1 mod 7
int	_test_59053_selectPhrases(FILE *istream, FILE *ostream)
{
	char str[1621], phrases[30][41];
	int min,max,result;
	//input data
	CHECK_ARG_NAME("str","selectPhrases");
	readString(istream,str,1621);
	CHECK_ARG_NAME("min","selectPhrases");
	min=readInt(istream);
	CHECK_ARG_NAME("max","selectPhrases");
	max=readInt(istream);

	//execute test
	GUARD_CALL(result=_59053_selectPhrases(str,min,max,phrases))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,30,_ERROR_WRONG_RETURN_VALUE,"returned","selectPhrases","0","30");
	ENSURE_END_OF_STRING_IN_TEXT(phrases,30,41,result,"phrases","selectPhrases");
	//output results
	writeOutArg(ostream, "phrases");
	writeChar2D<30,41>(ostream,phrases,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//1mod8
int	_test_454fb_cutString(FILE *istream, FILE *ostream)
{
	char str[21];
	int max;
	//input data
	CHECK_ARG_NAME("str","cutString");
	readString(istream,str,21);
	CHECK_ARG_NAME("max","cutString");
	max=readInt(istream);

	//execute test
	GUARD_CALL(_454fb_cutString(str,max))

	//check results for integrity
	ENSURE_END_OF_STRING(str,21,"str","cutString");
	//output results
	writeOutArg(ostream, "str");
	writeString(ostream, str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 2///////////////////////////////////////////////////////////////////////////
int _test_2_textToWords(FILE *istream, FILE *ostream)
{
	char text[20][81];
	char words[40][21];
	int result,count;
	//input data
	CHECK_ARG_NAME("text","textToWords");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","textToWords");
	count=readInt(istream);

	//execute test
	GUARD_CALL(result=_2_textToWords(text,count,words))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_ARRAY_SIZE,"words","textToWords","0","40");
	ENSURE_END_OF_STRING_IN_TEXT(words,40,21,result,"words","textToWords");
	//output results
	writeOutArg(ostream, "words");
	writeChar2D<40,21>(ostream,words,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_2_strToWords(FILE *istream, FILE *ostream)
{
	char str[81];
	int start,result;
	char words[40][21];
	//input data
	CHECK_ARG_NAME("str","strToWords");
	readString(istream,str,81);
	CHECK_ARG_NAME("start","strToWords");
	start=readInt(istream);
	CHECK_ARG_NAME("words","strToWords");
	readChar2D<40,21>(istream,words);

	//execute test
	GUARD_CALL(result=_2_strToWords(str,start,words))

	//check results for integrity
	CHECK_INT_LIMITS(result,0, 40-start,_ERROR_WRONG_ARRAY_SIZE,"words","strToWords","0","40 minus start");
	ENSURE_END_OF_STRING_IN_TEXT(words,40,21,result+start,"words","strToWords");
	//output results
	writeOutArg(ostream, "words");
	writeChar2D<40,21>(ostream,words,result+start);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//2mod6
int _test_b4974_getWord(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int strCount;
	int index;
	char word[21];
	//input data
	CHECK_ARG_NAME("text","getWord");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","getWord");
	strCount=readInt(istream);
	CHECK_ARG_NAME("index","getWord");
	index=readInt(istream);

	//execute test
	GUARD_CALL(_b4974_getWord(text,strCount,index,word))

	//check results for integrity
	ENSURE_END_OF_STRING(word,21,"word","getWord");
	//output results
	writeOutArg(ostream, "word");
	writeString(ostream,word);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 3///////////////////////////////////////////////////////////////////////////
int _test_3_crossStrings(FILE *istream, FILE *ostream)
{
	char str1[81];
	char str2[81];
	char words[40][21];
	int result;
	//input data
	CHECK_ARG_NAME("str1","crossStrings");
	readString(istream,str1,81);
	CHECK_ARG_NAME("str2","crossStrings");
	readString(istream,str2,81);

	//execute test
	GUARD_CALL(result=_3_crossStrings(str1,str2,words))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_ARRAY_SIZE,"words","crossStrings","0","40");
	ENSURE_END_OF_STRING_IN_TEXT(words,40,21,result,"words","crossStrings");
	//output results
	writeOutArg(ostream, "words");
	writeChar2D<40,21>(ostream,words,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_3_strToWords(FILE *istream, FILE *ostream)
{
	char str[81];
	int result;
	char words[40][21];
	//input data
	CHECK_ARG_NAME("str","strToWords");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(result=_3_strToWords(str,words))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_ARRAY_SIZE,"words","strToWords","0","40");
	ENSURE_END_OF_STRING_IN_TEXT(words,40,21,result,"words","strToWords");
	//output results
	writeOutArg(ostream, "words");
	writeChar2D<40,21>(ostream,words,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//3mod6
int _test_93be5_countWords(FILE *istream, FILE *ostream)
{
	char words[40][21];
	int count,result;
	char word[21];
	//input data
	CHECK_ARG_NAME("words","countWords");
	readChar2D<40,21>(istream,words);
	CHECK_ARG_NAME("count","countWords");
	count=readInt(istream);
	CHECK_ARG_NAME("word","countWords");
	readString(istream,word,21);

	//execute test
	GUARD_CALL(result=_93be5_countWords(words,count,word))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,count,_ERROR_WRONG_RETURN_VALUE,"returned","countWords","0","words count");
	//output results
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//3mod7
int	_test_c1d1b_uniteStrings(FILE *istream, FILE *ostream)
{
	char str1[81];
	char str2[81];
	char words[40][21];
	int result;
	//input data
	CHECK_ARG_NAME("str1","uniteStrings");
	readString(istream,str1,81);
	CHECK_ARG_NAME("str2","uniteStrings");
	readString(istream,str2,81);

	//execute test
	GUARD_CALL(result=_c1d1b_uniteStrings(str1,str2,words))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_ARRAY_SIZE,"words","uniteStrings","0","40");
	ENSURE_END_OF_STRING_IN_TEXT(words,40,21,result,"words","uniteStrings");
	//output results
	writeOutArg(ostream, "words");
	writeChar2D<40,21>(ostream,words,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//3mod8
int	_test_7e880_uniqueStrings(FILE *istream, FILE *ostream)
{
	char stringList[40][21];
	int strCount,result;
	//input data
	CHECK_ARG_NAME("stringList","uniqueStrings");
	readChar2D<40,21>(istream,stringList);
	CHECK_ARG_NAME("strCount","uniqueStrings");
	strCount=readInt(istream);

	//execute test
	GUARD_CALL(result=_7e880_uniqueStrings(stringList,strCount))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,strCount,_ERROR_WRONG_ARRAY_SIZE,"stringList","uniqueStrings","0","strings count");
	ENSURE_END_OF_STRING_IN_TEXT(stringList,40,21,result,"stringList","uniqueStrings");
	//output results
	writeOutArg(ostream, "stringList");
	writeChar2D<40,21>(ostream,stringList,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 4///////////////////////////////////////////////////////////////////////////
int _test_4_delCharacters(FILE *istream, FILE *ostream)
{
	char str[81];
	char characters[256];
	//input data
	CHECK_ARG_NAME("str","delCharacters");
	readString(istream,str,81);
	CHECK_ARG_NAME("characters","delCharacters");
	readString(istream,characters,256);	
	
	//execute test
	GUARD_CALL(_4_delCharacters(str,characters))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","delCharacters");
	//output results
	writeOutArg(ostream, "str");
	writeString(ostream,str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_4_cutString(FILE *istream, FILE *ostream)
{
	char str[81];
	int beginPos,endPos;
	//input data
	CHECK_ARG_NAME("str","cutString");
	readString(istream,str,81);
	CHECK_ARG_NAME("beginPos","cutString");
	beginPos=readInt(istream);
	CHECK_ARG_NAME("endPos","cutString");
	endPos=readInt(istream);

	//execute test
	GUARD_CALL(_4_cutString(str,beginPos,endPos))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","cutString");
	//output results
	writeOutArg(ostream, "str");
	writeString(ostream,str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//4mod6
int _test_6ec83_delFromText(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int strCount;
	char characters[256];
	//input data
	CHECK_ARG_NAME("text","delFromText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","delFromText");
	strCount=readInt(istream);
	CHECK_ARG_NAME("characters","delFromText");
	readString(istream,characters,256);	

	//execute test
	GUARD_CALL(_6ec83_delFromText(text,strCount,characters))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,strCount,"text","delFromText");
	//output results
	writeOutArg(ostream, "text");
	writeChar2D<20,81>(ostream,text,strCount);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//4mod7
int	_test_1f2a9_delSubstring(FILE *istream, FILE *ostream)
{
	char str[81];
	char substring[81];
	//input data
	CHECK_ARG_NAME("str","delSubstring");
	readString(istream,str,81);
	CHECK_ARG_NAME("substring","delSubstring");
	readString(istream,substring,81);	
	
	//execute test
	GUARD_CALL(_1f2a9_delSubstring(str,substring))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","delSubstring");
	//output results
	writeOutArg(ostream, "str");
	writeString(ostream,str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//4mod8
int	_test_97af7_delWord(FILE *istream, FILE *ostream)
{
	char str[81];
	char word[21];
	//input data
	CHECK_ARG_NAME("str","delWord");
	readString(istream,str,81);
	CHECK_ARG_NAME("word","delWord");
	readString(istream,word,21);	
	
	//execute test
	GUARD_CALL(_97af7_delWord(str,word))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","delWord");
	//output results
	writeOutArg(ostream, "str");
	writeString(ostream,str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 5///////////////////////////////////////////////////////////////////////////
int	_test_5_textToWords(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int  strCount;
	char *words[800];
	char wordLength[800];
	wordPointer2D wps[800];
	int i,result;
	//input data
	CHECK_ARG_NAME("text","textToWords");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","textToWords");
	strCount=readInt(istream);

	//execute test
	GUARD_CALL(result=_5_textToWords(text,strCount,words,wordLength))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,800,_ERROR_WRONG_ARRAY_SIZE,"words","textToWords","0","800");
	WPTR2_FROM_PTR_AND_LEN(wps,20,81,text,strCount,result,words,wordLength)
	//output results
	writeOutArg(ostream, wordPointer2D::arg_title);
	writePointer1D<wordPointer2D>(ostream,wps,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_5_textLength(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int strCount;
	int result;
	//input data
	CHECK_ARG_NAME("text","textLength");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","textLength");
	strCount=readInt(istream);

	//execute test
	GUARD_CALL(result=_5_textLength(text,strCount))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,1620,_ERROR_WRONG_RETURN_VALUE,"returned","textLength","0","1620");
	//output results
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
///////variant 5 mod 6
int _test_597e4_strToWords(FILE *istream, FILE *ostream)
{
	char str[81];
	int start,i,result;
	char *words[800];
	char **new_words;//new words, added by tested function
	char wordLength[800];
	char * new_wordLength;//length of new words, added by tested function
	wordPointer1D wps[800];
	//input data
	CHECK_ARG_NAME("str","strToWords");
	readString(istream,str,81);
	CHECK_ARG_NAME("start","strToWords");
	start=readInt(istream);
	new_words=words+start;
	new_wordLength=wordLength+start;

	//execute test
	GUARD_CALL(result=_597e4_strToWords(str,start,words,wordLength))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,800,_ERROR_WRONG_ARRAY_SIZE,"words","textToWords","0","800");
	WPTR1_FROM_PTR_AND_LEN(wps,str,result,new_words,new_wordLength)
	//output results
	writeOutArg(ostream, wordPointer1D::arg_title);
	writePointer1D<wordPointer1D>(ostream,wps,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//5mod7
int	_test_a46a5_minimum(FILE *istream, FILE *ostream)
{
	char arr[800];
	int count,result, mins[800], values[800];
	//input data
	CHECK_ARG_NAME("arr","minimum");
	readInt1D(istream,values,800);
	CHECK_ARG_NAME("count","minimum");
	count=readInt(istream);
	for(int i=0;i<count;i++)//to avoid writing readChar1D use readInt1D and convert to char array
		arr[i]=(char)values[i];

	//execute test
	GUARD_CALL(result=_a46a5_minimum(arr,count,mins))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,count,_ERROR_WRONG_ARRAY_SIZE,"mins","minimum","1","strings count");
	CHECK_INT_ARRAY_LIMITS(mins,result,0,count-1,"mins","minimum","0","numbers count minus 1");
	//output results
	writeOutArg(ostream, "mins");
	writeInt1D(ostream,mins,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//5mod8
int	_test_f579b_isEndOfSentence(FILE *istream, FILE *ostream)
{
	char text[20][81];
	char *word;
	int N, result;
	//input data
	CHECK_ARG_NAME("text","isEndOfSentence");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("N","isEndOfSentence");
	N=readInt(istream);
	CHECK_ARG_NAME("word","isEndOfSentence");
	if (!(word = readPCharIn2D<20,81>(istream,text)))
	{
		fprintf(ostream,"INPUT %s",wordPointer::err_desc[4]);
		return TESTRES_WRONG_INPUT_DATA;
	}

	//execute test
	GUARD_CALL(result=_f579b_isEndOfSentence(text,N,word))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,1,_ERROR_WRONG_RETURN_VALUE,"returned","isEndOfSentence","0","1");
	//output results
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 6///////////////////////////////////////////////////////////////////////////
int _test_6_getNumbers(FILE *istream, FILE *ostream)
{
	char str[81];
	int numbers[40];
	int result;
	//input data
	CHECK_ARG_NAME("str","getNumbers");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(result=_6_getNumbers(str,numbers))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_ARRAY_SIZE,"numbers","getNumbers","0","40");
	//output results
	writeOutArg(ostream, "numbers");
	writeInt1D(ostream,numbers,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_6_findInteger(FILE *istream, FILE *ostream)
{
	char str[81];
	char *end;
	int result;
	//input data
	CHECK_ARG_NAME("str","findInteger");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(result=_6_findInteger(str,&end))

	//check results for integrity
	ENSURE_POINTER_IN_STRING_OR_NULL(str,end,"str","end","findInteger");
	//output results
	writeOutArg(ostream, "end");
	if(end!=NULL)
	{
		writeInt(ostream,end-str);
		writeOutArg(ostream, "return");
		writeInt(ostream,result);
	}
	else
		writeString(ostream,"no number found");
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
///////variant 6 mod 6
int _test_beb12_getNumbersFromText(FILE *istream, FILE *ostream)
{	
	char text[20][81];
	int strCount;
	int numbers[40];
	int result;
	//input data
	CHECK_ARG_NAME("text","getNumbersFromText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","getNumbersFromText");
	strCount=readInt(istream);

	//execute test
	GUARD_CALL(result=_beb12_getNumbersFromText(text,strCount,numbers))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_ARRAY_SIZE,"numbers","getNumbersFromText","0","40");
	//output results
	writeOutArg(ostream, "numbers");
	writeInt1D(ostream,numbers,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//6mod7 & 8
int _test_8f7d2_getNumbers(FILE *istream, FILE *ostream)
{
	char str[81];
	float numbers[40];
	int result;
	//input data
	CHECK_ARG_NAME("str","getNumbers");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(result=_8f7d2_getNumbers(str,numbers))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_ARRAY_SIZE,"numbers","getNumbers","0","40");
	//output results
	writeOutArg(ostream, "numbers");
	writeFloat1D(ostream,numbers,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_8f7d2_findFloat(FILE *istream, FILE *ostream)
{
	char str[81];
	char *end;
	float result;
	//input data
	CHECK_ARG_NAME("str","findFloat");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(result=_8f7d2_findFloat(str,&end))

	//check results for integrity
	ENSURE_POINTER_IN_STRING_OR_NULL(str,end,"str","end","findFloat");
	//output results
	writeOutArg(ostream, "end");
	if(end!=NULL)
	{
		writeInt(ostream,end-str);
		writeOutArg(ostream, "return");
		writeFloat(ostream,result);
	}
	else
		writeString(ostream,"no number found");
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 7///////////////////////////////////////////////////////////////////////////
int _test_7_sortByStringLength(FILE *istream, FILE *ostream)
{
	char stringList[40][21];
	int count;
	//input data
	CHECK_ARG_NAME("stringList","sortByStringLength");
	readChar2D<40,21>(istream,stringList);
	CHECK_ARG_NAME("count","sortByStringLength");
	count=readInt(istream);

	//execute test
	GUARD_CALL(_7_sortByStringLength(stringList,count))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(stringList,40,21,count,"stringList","sortByStringLength");
	//output results
	writeOutArg(ostream, "stringList");
	writeChar2D<40,21>(ostream,stringList,count);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//7mod6
//using _test_2_strToWords
//7mod7
int _test_3643e_sortByStringLength(FILE *istream, FILE *ostream)
{
	char stringList[40][21];
	int count, direction;
	//input data
	CHECK_ARG_NAME("stringList","sortByStringLength");
	readChar2D<40,21>(istream,stringList);
	CHECK_ARG_NAME("count","sortByStringLength");
	count=readInt(istream);
	CHECK_ARG_NAME("direction","sortByStringLength");
	direction=readInt(istream);

	//execute test
	GUARD_CALL(_3643e_sortByStringLength(stringList,count,direction))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(stringList,40,21,count,"stringList","sortByStringLength");
	//output results
	writeOutArg(ostream, "stringList");
	writeChar2D<40,21>(ostream,stringList,count);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//7mod8
int _test_ae399_compareString(FILE *istream, FILE *ostream)
{
	char str1[21],str2[21],alphabet[256];
	int result;
	//input data
	CHECK_ARG_NAME("str1","compareString");
	readString(istream,str1,21);
	CHECK_ARG_NAME("str2","compareString");
	readString(istream,str2,21);
	CHECK_ARG_NAME("alphabet","compareString");
	readString(istream,alphabet,256);

	//execute test
	GUARD_CALL(result=_ae399_compareString(str1,str2,alphabet))

	//check results for integrity
	CHECK_INT_LIMITS(result,-1,1,_ERROR_WRONG_RETURN_VALUE,"returned","compareString","-1","1");
	//output results
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 8///////////////////////////////////////////////////////////////////////////
int _test_8_insertString(FILE *istream, FILE *ostream)
{
	char destinString[81];
	char sourceString[81];
	int characterIndex,result;
	//input data
	CHECK_ARG_NAME("destinString","insertString");
	readString(istream,destinString,81);
	CHECK_ARG_NAME("sourceString","insertString");
	readString(istream,sourceString,81);
	CHECK_ARG_NAME("characterIndex","insertString");
	characterIndex=readInt(istream);

	//execute test
	GUARD_CALL(result=_8_insertString(destinString,sourceString,characterIndex))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,1,_ERROR_WRONG_RETURN_VALUE,"returned","insertString","0","1");
	ENSURE_END_OF_STRING(destinString,81,"destinString","insertString")
	//output results
	writeOutArg(ostream, "destinString");
	writeString(ostream,destinString);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_8_findCharInText(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int N,result,line,column;
	char character;
	//input data
	CHECK_ARG_NAME("text","findCharInText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("N","findCharInText");
	N=readInt(istream);
	CHECK_ARG_NAME("character","findCharInText");
	character=readChar(istream);
	CHECK_ARG_NAME("line","findCharInText");
	line=readInt(istream);
	CHECK_ARG_NAME("column","findCharInText");
	column=readInt(istream);

	//execute test
	GUARD_CALL(result=_8_findCharInText(text,N,character,&line,&column))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,1,_ERROR_WRONG_RETURN_VALUE,"returned","findCharInText","0","1");
	CHECK_INT_LIMITS(line,-1,N-1,_ERROR_WRONG_RETURN_ARG,"line","findCharInText","-1","count of lines minus 1");
	CHECK_INT_LIMITS(column,-1,(int)strlen(text[line]),_ERROR_WRONG_RETURN_ARG,"column","findCharInText","-1","string length");
	//output results
	writeOutArg(ostream, "line");
	writeInt(ostream,line);
	writeOutArg(ostream, "column");
	writeInt(ostream,column);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//8mod6
int _test_aaaa9_insertStringBefore(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int N;
	char str[81];
	char character;
	//input data
	CHECK_ARG_NAME("text","insertStringBefore");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("N","insertStringBefore");
	N=readInt(istream);
	CHECK_ARG_NAME("str","insertStringBefore");
	readString(istream,str,81);
	CHECK_ARG_NAME("character","insertStringBefore");
	character=readChar(istream);

	//execute test
	GUARD_CALL(_aaaa9_insertStringBefore(text,N,str,character))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,N,"text","insertStringBefore");
	//output results
	writeOutArg(ostream, "text");
	writeChar2D<20,81>(ostream,text,N);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//8mod7
int _test_622d9_findSubstrInText(FILE *istream, FILE *ostream)
{
	char text[20][81], substring[81];
	int strCount,result,line,column;
	//input data
	CHECK_ARG_NAME("text","findSubstrInText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","findSubstrInText");
	strCount=readInt(istream);
	CHECK_ARG_NAME("substring","findSubstrInText");
	readString(istream,substring,81);
	CHECK_ARG_NAME("line","findSubstrInText");
	line=readInt(istream);
	CHECK_ARG_NAME("column","findSubstrInText");
	column=readInt(istream);

	//execute test
	GUARD_CALL(result=_622d9_findSubstrInText(text,strCount,substring,&line,&column))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,1,_ERROR_WRONG_RETURN_VALUE,"returned","findSubstrInText","0","1");
	if(result)
	{
		CHECK_INT_LIMITS(line,0,strCount-1,_ERROR_WRONG_RETURN_ARG,"line","findSubstrInText","0","count of lines minus 1");
		CHECK_INT_LIMITS(column,0,strlen(text[line]),_ERROR_WRONG_RETURN_ARG,"column","findSubstrInText","0","string length");
	}
	//output results
	if(result)
	{
		writeOutArg(ostream, "line");
		writeInt(ostream,line);
		writeOutArg(ostream, "column");
		writeInt(ostream,column);
	}
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	return TESTRES_SUCCESS;
}
//8mod8
int _test_1191a_insertStrToText(FILE *istream, FILE *ostream)
{
	char text[20][81],str[81];
	int strCount,strIndex,result;
	//input data
	CHECK_ARG_NAME("text","insertStrToText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","insertStrToText");
	strCount=readInt(istream);
	CHECK_ARG_NAME("str","insertStrToText");
	readString(istream,str,81);
	CHECK_ARG_NAME("strIndex","insertStrToText");
	strIndex=readInt(istream);

	//execute test
	GUARD_CALL(result=_1191a_insertStrToText(text,strCount,str,strIndex))

	//check results for integrity
	CHECK_INT_LIMITS(result,strCount+1,strCount+1,_ERROR_WRONG_RETURN_VALUE,"returned","insertStrToText","count of strings plus 1","count of strings plus 1");
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,result,"text","insertStrToText");
	//output results
	writeOutArg(ostream, "text");
	writeChar2D<20,81>(ostream,text,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 9///////////////////////////////////////////////////////////////////////////
int _test_9_findPairBrackets(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int strCount,lineIndex,characterIndex;
	int brackets[4];
	//input data
	CHECK_ARG_NAME("text","findPairBrackets");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","findPairBrackets");
	strCount=readInt(istream);
	CHECK_ARG_NAME("lineIndex","findPairBrackets");
	lineIndex=readInt(istream);
	CHECK_ARG_NAME("characterIndex","findPairBrackets");
	characterIndex=readInt(istream);

	//execute test
	GUARD_CALL(_9_findPairBrackets(text,strCount,lineIndex,characterIndex,brackets))

	//check results for integrity
	CHECK_INT_LIMITS(brackets[0],-1,strCount,_ERROR_WRONG_RETURN_ARG,"brackets[0]","findPairBrackets","-1","strings count");
	if(brackets[0]>0)
	{
		ENSURE_POINTER_IN_STRING(text[brackets[0]],text[brackets[0]]+brackets[1],"text","brackets[1]","findPairBrackets");
	}
	else
	{
		CHECK_INT_LIMITS(brackets[1],-1,-1,_ERROR_WRONG_RETURN_ARG,"brackets[1]","findPairBrackets","-1","-1");
	}
	CHECK_INT_LIMITS(brackets[2],-1,strCount,_ERROR_WRONG_RETURN_ARG,"brackets[2]","findPairBrackets","-1","strings count");
	if(brackets[2]>0)
	{
		ENSURE_POINTER_IN_STRING(text[brackets[2]],text[brackets[2]]+brackets[3],"text","brackets[3]","findPairBrackets");
	}
	else
	{
		CHECK_INT_LIMITS(brackets[3],-1,-1,_ERROR_WRONG_RETURN_ARG,"brackets[3]","findPairBrackets","-1","-1");
	}
	//output results
	writeOutArg(ostream, "brackets");
	writeInt1D(ostream,brackets,4);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//9mod6
int _test_1bec2_cutText(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int strCount,startStrIndex,startCharIndex,endStrIndex,endCharIndex,result;
	//input data
	CHECK_ARG_NAME("text","cutText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","cutText");
	strCount=readInt(istream);
	CHECK_ARG_NAME("startStrIndex","cutText");
	startStrIndex=readInt(istream);
	CHECK_ARG_NAME("startCharIndex","cutText");
	startCharIndex=readInt(istream);
	CHECK_ARG_NAME("endStrIndex","cutText");
	endStrIndex=readInt(istream);
	CHECK_ARG_NAME("endCharIndex","cutText");
	endCharIndex=readInt(istream);

	//execute test
	GUARD_CALL(result=_1bec2_cutText(text,strCount,startStrIndex,startCharIndex,endStrIndex,endCharIndex))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,strCount,_ERROR_WRONG_RETURN_VALUE,"returned","cutText","0","strings count");
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,result,"text","cutText");
	//output results
	writeOutArg(ostream, "text");
	writeChar2D<20,81>(ostream,text,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//9mod7
int _test_7a70f_countInvalidBrackets(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int strCount,errors[60][2],result;
	//input data
	CHECK_ARG_NAME("text","countInvalidBrackets");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","countInvalidBrackets");
	strCount=readInt(istream);

	//execute test
	GUARD_CALL(result=_7a70f_countInvalidBrackets(text,strCount,errors))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,60,_ERROR_WRONG_RETURN_VALUE,"returned","countInvalidBrackets","0","60");
	CHECK_LOCATIONS_IN2D(text,strCount,errors,result,"errors","countInvalidBrackets",0);
	//output results
	writeOutArg(ostream, "errors");
	writeInt2D<60,2>(ostream,errors,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//9mod 8 & 9
int _test_c46f2_cutBracketsFromText(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int strCount,result;
	//input data
	CHECK_ARG_NAME("text","cutBracketsFromText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","cutBracketsFromText");
	strCount=readInt(istream);

	//execute test
	GUARD_CALL(result=_c46f2_cutBracketsFromText(text,strCount))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,strCount,_ERROR_WRONG_RETURN_VALUE,"returned","cutBracketsFromText","0","strings count");
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,result,"text","cutBracketsFromText");
	//output results
	writeOutArg(ostream, "text");
	writeChar2D<20,81>(ostream,text,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 10///////////////////////////////////////////////////////////////////////////
int _test_10_markWords(FILE *istream, FILE *ostream)
{
	char str[81],word[21];
	//input data
	CHECK_ARG_NAME("str","markWords");
	readString(istream,str,81);
	CHECK_ARG_NAME("word","markWords");
	readString(istream,word,21);

	//execute test
	GUARD_CALL(_10_markWords(str,word))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","markWords");
	//output results
	writeOutArg(ostream, "str");
	writeString(ostream, str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_10_searchWord(FILE *istream, FILE *ostream)
{
	char str[81],word[21];
	int result;
	//input data
	CHECK_ARG_NAME("str","searchWord");
	readString(istream,str,81);
	CHECK_ARG_NAME("word","searchWord");
	readString(istream,word,21);

	//execute test
	GUARD_CALL(result=_10_searchWord(str,word))

	//check results for integrity
	CHECK_INT_LIMITS(result,-1,(int)strlen(str),_ERROR_WRONG_RETURN_VALUE,"returned","searchWord","-1","strings length");
	//output results
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_10_slideString(FILE *istream, FILE *ostream)
{
	char str[81];
	int pos, growth;
	char spacer;
	//input data
	CHECK_ARG_NAME("str","slideString");
	readString(istream,str,81);
	CHECK_ARG_NAME("pos","slideString");
	pos=readInt(istream);
	CHECK_ARG_NAME("growth","slideString");
	growth=readInt(istream);
	CHECK_ARG_NAME("spacer","slideString");
	spacer=readChar(istream);

	//execute test
	GUARD_CALL(_10_slideString(str,pos,growth,spacer))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","slideString");
	//output results
	writeOutArg(ostream, "str");
	writeString(ostream, str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//10mod6
int _test_25b24_markWordsInText(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int strCount;
	char word[21];
	//input data
	CHECK_ARG_NAME("text","markWordsInText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","markWordsInText");
	strCount=readInt(istream);
	CHECK_ARG_NAME("word","markWordsInText");
	readString(istream,word,21);

	//execute test
	GUARD_CALL(_25b24_markWordsInText(text,strCount,word))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,strCount,"text","markWordsInText");
	//output results
	writeOutArg(ostream, "text");
	writeChar2D<20,81>(ostream,text,strCount);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//10mod7
int _test_efc2b_duplicateWords(FILE *istream, FILE *ostream)
{
	char text[20][81],word[21];
	int strCount;
	//input data
	CHECK_ARG_NAME("text","duplicateWords");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","duplicateWords");
	strCount=readInt(istream);
	CHECK_ARG_NAME("word","duplicateWords");
	readString(istream,word,21);

	//execute test
	GUARD_CALL(_efc2b_duplicateWords(text,strCount,word))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,strCount,"text","duplicateWords");
	//output results
	writeOutArg(ostream, "text");
	writeChar2D<20,81>(ostream,text,strCount);
	return TESTRES_SUCCESS;
}
//10mod8
int _test_e18c0_entryCount(FILE *istream, FILE *ostream)
{
	char text[20][81],word[21];
	int strCount,result;
	//input data
	CHECK_ARG_NAME("text","entryCount");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","entryCount");
	strCount=readInt(istream);
	CHECK_ARG_NAME("word","entryCount");
	readString(istream,word,21);

	//execute test
	GUARD_CALL(result=_e18c0_entryCount(text,strCount,word))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,800,_ERROR_WRONG_RETURN_VALUE,"returned","entryCount","0","800");
	//output results
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 11///////////////////////////////////////////////////////////////////////////
int _test_11_deleteBlanks(FILE *istream, FILE *ostream)
{
	char str[81];
	//input data
	CHECK_ARG_NAME("str","deleteBlanks");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(_11_deleteBlanks(str))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","deleteBlanks");
	//output results
	writeOutArg(ostream, "str");
	writeString(ostream,str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//11mod 6 & 8
int _test_eb290_deleteBlanksFromText(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int strCount;
	//input data
	CHECK_ARG_NAME("text","deleteBlanksFromText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","deleteBlanksFromText");
	strCount=readInt(istream);

	//execute test
	GUARD_CALL(_eb290_deleteBlanksFromText(text,strCount))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,strCount,"text","deleteBlanksFromText");
	//output results
	for(int i=0;i<strCount;i++)//set leading spaces to '*' to make testing easier
		for(int j=0;text[i][j]==' ';j++)
			text[i][j]='*';
	writeOutArg(ostream, "text");
	writeChar2D<20,81>(ostream,text,strCount);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//11mod7
int _test_3ec7d_deleteDelimiters(FILE *istream, FILE *ostream)
{
	char str[81];
	//input data
	CHECK_ARG_NAME("str","deleteDelimiters");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(_3ec7d_deleteDelimiters(str))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","deleteDelimiters");
	//output results
	writeOutArg(ostream, "str");
	writeString(ostream,str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//11mod8
int _test_b37fd_findNextQuote(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int strCount, line, column, result;
	//input data
	CHECK_ARG_NAME("text","findNextQuote");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","findNextQuote");
	strCount=readInt(istream);
	CHECK_ARG_NAME("line","findNextQuote");
	line=readInt(istream);
	CHECK_ARG_NAME("column","findNextQuote");
	column=readInt(istream);

	//execute test
	GUARD_CALL(result=_b37fd_findNextQuote(text,strCount,&line,&column))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,1,_ERROR_WRONG_RETURN_VALUE,"returned","findNextQuote","0","1");
	if(result)
	{
		CHECK_INT_LIMITS(line,0,strCount-1,_ERROR_WRONG_RETURN_ARG,"line","findNextQuote","0","strings count");
		CHECK_INT_LIMITS(column,0,strlen(text[line]),_ERROR_WRONG_RETURN_ARG,"column","findNextQuote","0","string lentgh");
	}
	//output results
	if(result)
	{
		writeOutArg(ostream,"line");
		writeInt(ostream,line);
		writeOutArg(ostream,"column");
		writeInt(ostream,column);
	}
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 12///////////////////////////////////////////////////////////////////////////
int _test_12_markWords(FILE *istream, FILE *ostream)
{
	char word[21], words[40][21];
	int nWords, result;
	int isEqual[40]={};
	//input data
	CHECK_ARG_NAME("word","markWords");
	readString(istream,word,21);
	CHECK_ARG_NAME("words","markWords");
	readChar2D<40,21>(istream,words);
	CHECK_ARG_NAME("nWords","markWords");
	nWords=readInt(istream);

	//execute test
	GUARD_CALL(result=_12_markWords(word,words,nWords,isEqual))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,nWords,_ERROR_WRONG_RETURN_VALUE,"returned","markWords","0","words count");
	CHECK_INT_ARRAY_LIMITS(isEqual,nWords,0,1,"isEqual","markWords","0","1");
	//output results
	writeOutArg(ostream, "isEqual");
	writeInt1D(ostream,isEqual,nWords);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//12mod6
int _test_2ae70_compositionStrings(FILE *istream, FILE *ostream)
{
	char str1[81], str2[81];
	int result;
	//input data
	CHECK_ARG_NAME("str1","compositionStrings");
	readString(istream,str1,81);
	CHECK_ARG_NAME("str2","compositionStrings");
	readString(istream,str2,81);

	//execute test
	GUARD_CALL(result=_2ae70_compositionStrings(str1,str2))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,1,_ERROR_WRONG_RETURN_VALUE,"returned","compositionStrings","0","1");
	//output results
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//12mod7
int _test_62a5d_compareStringList(FILE *istream, FILE *ostream)
{
	char stringList1[40][21],stringList2[40][21];
	int count1, count2;
	int result;
	//input data
	CHECK_ARG_NAME("stringList1","compareStringList");
	readChar2D<40,21>(istream,stringList1);
	CHECK_ARG_NAME("count1","compareStringList");
	count1=readInt(istream);
	CHECK_ARG_NAME("stringList2","compareStringList");
	readChar2D<40,21>(istream,stringList2);
	CHECK_ARG_NAME("count2","compareStringList");
	count2=readInt(istream);

	//execute test
	GUARD_CALL(result=_62a5d_compareStringList(stringList1,count1,stringList2,count2))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,1,_ERROR_WRONG_RETURN_VALUE,"returned","compareStringList","0","1");
	//output results
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//12mod8
int _test_05967_strToWords(FILE *istream, FILE *ostream)
{
	char str[81],words[40][21],delimeters[81];
	int result;
	//input data
	CHECK_ARG_NAME("str","strToWords");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(result=_05967_strToWords(str,words,delimeters))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_RETURN_VALUE,"returned","strToWords","0","1");
	ENSURE_END_OF_STRING_IN_TEXT(words,40,21,result,"words","strToWords");
	ENSURE_END_OF_STRING(delimeters,81,"delimeters","strToWords");
	//output results
	writeOutArg(ostream, "words");
	writeChar2D<40,21>(ostream,words,result);
	writeOutArg(ostream, "delimeters");
	writeString(ostream,delimeters);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 13///////////////////////////////////////////////////////////////////////////
int _test_13_searchString(FILE *istream, FILE *ostream)
{
	char stringList[30][41];
	int count,result;
	char str[41];
	//input data
	CHECK_ARG_NAME("stringList","searchString");
	readChar2D<30,41>(istream,stringList);
	CHECK_ARG_NAME("count","searchString");
	count=readInt(istream);
	CHECK_ARG_NAME("str","searchString");
	readString(istream,str,41);

	//execute test
	GUARD_CALL(result=_13_searchString(stringList,count,str))

	//check results for integrity
	CHECK_INT_LIMITS(result,-1,count-1,_ERROR_WRONG_RETURN_VALUE,"returned","searchString","-1","strings count minus 1");
	//output results
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

int _test_13_slideStringList(FILE *istream, FILE *ostream)
{
	char stringList[30][41];
	int count,result,strIndex;
	//input data
	CHECK_ARG_NAME("stringList","slideStringList");
	readChar2D<30,41>(istream,stringList);
	CHECK_ARG_NAME("count","slideStringList");
	count=readInt(istream);
	CHECK_ARG_NAME("strIndex","slideStringList");
	strIndex=readInt(istream);

	//execute test
	GUARD_CALL(result=_13_slideStringList(stringList, count, strIndex))

	//check results for integrity
	CHECK_INT_LIMITS(result,count+1,count+1,_ERROR_WRONG_ARRAY_SIZE,"stringList","slideStringList","strings count plus 1","strings count plus 1");
	ENSURE_END_OF_STRING_IN_TEXT(stringList,30,41,count+1,"stringList","slideStringList");
	//output results
	writeOutArg(ostream, "stringList");
	writeChar2D<30,41>(ostream, stringList, result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//13mod6
int _test_02b98_insertToStringList(FILE *istream, FILE *ostream)
{
	char stringList[30][41];
	int count;
	char str[41];
	//input data
	CHECK_ARG_NAME("stringList","insertToStringList");
	readChar2D<30,41>(istream,stringList);
	CHECK_ARG_NAME("count","insertToStringList");
	count=readInt(istream);
	CHECK_ARG_NAME("str","insertToStringList");
	readString(istream,str,41);

	//execute test
	GUARD_CALL(_02b98_insertToStringList(stringList,count,str))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(stringList,30,41,count+1,"stringList","insertToStringList");
	//output results
	writeOutArg(ostream, "stringList");
	writeChar2D<30,41>(ostream, stringList, count+1);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//13mod7
int _test_d5d5b_getRating(FILE *istream, FILE *ostream)
{
	char str[41];
	float result;
	//input data
	CHECK_ARG_NAME("str","getRating");
	readString(istream,str,41);

	//execute test
	GUARD_CALL(result=_d5d5b_getRating(str))

	//check results for integrity
	//float numbers doesn't need checking
	//output results
	writeOutArg(ostream, "return");
	writeFloat(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//13mod8
int _test_69305_packStringList(FILE *istream, FILE *ostream)
{
	char stringList[30][41];
	int count, strIndex, result;
	//input data
	CHECK_ARG_NAME("stringList","packStringList");
	readChar2D<30,41>(istream,stringList);
	CHECK_ARG_NAME("count","packStringList");
	count=readInt(istream);
	CHECK_ARG_NAME("strIndex","packStringList");
	strIndex=readInt(istream);

	//execute test
	GUARD_CALL(result=_69305_packStringList(stringList,count,strIndex))

	//check results for integrity
	CHECK_INT_LIMITS(result,count-1,count-1,_ERROR_WRONG_ARRAY_SIZE,"stringList","packStringList","strings count minus 1","strings count minus 1");
	ENSURE_END_OF_STRING_IN_TEXT(stringList,30,41,result,"stringList","packStringList");
	//output results
	writeOutArg(ostream, "stringList");
	writeChar2D<30,41>(ostream, stringList,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 14///////////////////////////////////////////////////////////////////////////
int _test_14_countWordsByLetter(FILE *istream, FILE *ostream)
{
	char *words[40];
	int wordLength[40];
	int wordCount, letters[32];
	char str[81];
	fprintf(ostream,_DEPENDENT_TESTING,"strToWords");
	//input data
	CHECK_ARG_NAME("str","countWordsByLetter");
	readString(istream,str,81);	
	//dependent testing - prepare input data using student's function
	GUARD_CALL(wordCount=_16_strToWords(str,words,wordLength))
	CHECK_INT_LIMITS(wordCount,0,40,_ERROR_WRONG_ARRAY_SIZE,"words","countWordsByLetter","0","40");

	//execute test
	GUARD_CALL(_14_countWordsByLetter(words,wordLength,wordCount,letters))
	
	//check results for integrity
	CHECK_INT_ARRAY_LIMITS(letters,32,0,wordCount,"letters","countWordsByLetter","0","words count");
	//output results
	writeOutArg(ostream, "letters");
	writeInt1D(ostream, letters,32);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//14mod6
int _test_a120f_startWords(FILE *istream, FILE *ostream)
{
	char text[20][81];
	char letters[32];
	char letters1[33];
	int result;
	//input data
	CHECK_ARG_NAME("text","startWords");
	readChar2D<20,81>(istream,text);

	//execute test
	GUARD_CALL(result=_a120f_startWords(text,letters))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,32,_ERROR_WRONG_ARRAY_SIZE,"text","startWords","0","32");
	strncpy(letters1,letters,result);
	letters1[result]=0;//insert end of the string to output letters
	//output results
	writeOutArg(ostream, "letters");
	writeString(ostream,letters1);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//14mod7
int _test_2ffe4_startWords(FILE *istream, FILE *ostream)
{
	char *words[40];
	int wordLength[40];
	int count, result;
	char str[81], character;
	fprintf(ostream,_DEPENDENT_TESTING,"strToWords");
	//input data
	CHECK_ARG_NAME("str","startWords");
	readString(istream,str,81);	
	//dependent testing - prepare input data using student's function
	GUARD_CALL(count=_16_strToWords(str,words,wordLength))
	CHECK_INT_LIMITS(count,0,40,_ERROR_WRONG_ARRAY_SIZE,"words","startWords","0","40");
	CHECK_ARG_NAME("character","startWords");
	character=readChar(istream);

	//execute test
	GUARD_CALL(result=_2ffe4_startWords(words,count,character))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,count,_ERROR_WRONG_RETURN_VALUE,"returned","startWords","0","words count");
	//output results
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//14mod8
int _test_0523c_lettersString(FILE *istream, FILE *ostream)
{
	char str[21];
	int result;
	//input data
	CHECK_ARG_NAME("str","lettersString");
	readString(istream,str,21);

	//execute test
	GUARD_CALL(result=_0523c_lettersString(str))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,strlen(str),_ERROR_WRONG_RETURN_VALUE,"returned","lettersString","0","string lenght");
	//output results
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 15///////////////////////////////////////////////////////////////////////////
int _test_15_strToWords(FILE *istream, FILE *ostream)
{
	char str[81];
	int words[40][2];
	int result;
	int i;
	char buffer[100];
	wordPointer1D wps[40];
	//input data
	CHECK_ARG_NAME("str","strToWords");
	readString(istream,str,81);
	int str_size=strlen(str);

	//execute test
	GUARD_CALL(result=_15_strToWords(str,words))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_ARRAY_SIZE,"words","strToWords","0","40");
	WPTR1_FROM_INDX_PAIR(wps,str,result,words);
	//output results
	writeOutArg(ostream, wordPointer1D::arg_title);
	writePointer1D<wordPointer1D>(ostream,wps,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_15_compareByContents(FILE *istream, FILE *ostream)
{
	char str1[21],str2[21];
	int result;
	//input data
	CHECK_ARG_NAME("str1","compareByContents");
	readString(istream,str1,21);
	CHECK_ARG_NAME("str2","compareByContents");
	readString(istream,str2,21);

	//execute test
	GUARD_CALL(result=_15_compareByContents(str1,str2))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,1,_ERROR_WRONG_RETURN_VALUE,"returned","compareByContents","0","1");
	//output results
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//15mod6
int _test_f8595_equalWords(FILE *istream, FILE *ostream)
{
	char str[81];
	char word_groups[10][10][21];
	int result,i;
	char tmp[40];
	//input data
	CHECK_ARG_NAME("str","equalWords");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(result=_f8595_equalWords(str,word_groups))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,10,_ERROR_WRONG_ARRAY_SIZE,"word_groups","compareByContents","0","10");
	for(i=0;i<result;i++)
	{
		sprintf(tmp,"word_groups[%d]",i);
		ENSURE_END_OF_STRING_IN_TEXT(word_groups[i],10,21,10,tmp,"compareByContents");
	}
	//output results
	writeOutArg(ostream, "word_groups");
	writeChar3D<10,10,21>(ostream,word_groups,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//15mod7 & 8
int _test_a77a5_differenceByContents(FILE *istream, FILE *ostream)
{
	char str1[21],str2[21];
	int result;
	//input data
	CHECK_ARG_NAME("str1","differenceByContents");
	readString(istream,str1,21);
	CHECK_ARG_NAME("str2","differenceByContents");
	readString(istream,str2,21);

	//execute test
	GUARD_CALL(result=_a77a5_differenceByContents(str1,str2))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,strlen(str1)+strlen(str2),_ERROR_WRONG_RETURN_VALUE,"returned","differenceByContents","0","summ of string lenghts");
	//output results
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}	

//////////////////////////////Variant 16///////////////////////////////////////////////////////////////////////////
int _test_16_strToWords(FILE *istream, FILE *ostream)
{
	char str [81];
	char *words[40];
	int wordLength[40];
	int result,i;
	wordPointer1D wps[40];
	//input data
	CHECK_ARG_NAME("str","strToWords");
	readString(istream,str,81);	

	//execute test
	GUARD_CALL(result=_16_strToWords(str,words,wordLength))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_ARRAY_SIZE,"words","strToWords","0","40");
	WPTR1_FROM_PTR_AND_LEN(wps,str,result,words,wordLength);
	//output results
	writeOutArg(ostream, wordPointer1D::arg_title);
	writePointer1D<wordPointer1D>(ostream,wps,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_16_selectWords(FILE *istream, FILE *ostream)
{
	char str[81];
	char *words[40];
	int wordLength[40];
	int wordCount;
	char prefix[40];
	int wordIndexes[40];
	int result,i;
	char tmp[100];
	fprintf(ostream,_DEPENDENT_TESTING,"strToWords");
	//input data
	CHECK_ARG_NAME("str","selectWords");
	readString(istream,str,81);	
	CHECK_ARG_NAME("prefix","selectWords");
	readString(istream,prefix,40);	
	//dependent testing - prepare input data using student's function
	GUARD_CALL(wordCount=_16_strToWords(str,words,wordLength))
	CHECK_INT_LIMITS(wordCount,0,40,_ERROR_WRONG_ARRAY_SIZE,"words","strToWords","0","40");

	//execute test
	GUARD_CALL(result=_16_selectWords(words,wordLength,wordCount,prefix,wordIndexes))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,wordCount,_ERROR_WRONG_ARRAY_SIZE,"wordIndexes","selectWords","0","words count");
	CHECK_INT_ARRAY_LIMITS(wordIndexes,result,0,wordCount-1,"wordIndexes","selectWords","0","words count minus 1");
	//output results
	writeOutArg(ostream, "wordIndex => word");
	if(result==0)
		fprintf(ostream,"|||empty|||\n");
	for(i=0;i<result;i++)
	{
		sprintf(tmp,"%d => ",wordIndexes[i]);
		strncat(tmp,words[wordIndexes[i]],wordLength[wordIndexes[i]]);
		writeString(ostream, tmp);
	}
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
///////variant 16 mod 6 and 7
int _test_16mods67_findWordFromText(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int count;
	char prefix[40];
	char words[30][21];
	int result;
	//input data
	CHECK_ARG_NAME("text","findWordFromText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("count","findWordFromText");
	count=readInt(istream);
	CHECK_ARG_NAME("prefix","findWordFromText");
	readString(istream,prefix,40);

	//execute test
	GUARD_CALL(result=_58b3b_findWordFromText(text,count,prefix,words))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,30,_ERROR_WRONG_ARRAY_SIZE,"words","findWordFromText","0","30");
	ENSURE_END_OF_STRING_IN_TEXT(words,30,21,result,"words","findWordFromText");
	//output results
	writeOutArg(ostream,"words");
	writeChar2D<30,21>(ostream,words,result);
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_142d2_findFIO(FILE *istream, FILE *ostream)
{
	char str[81],surname[21];
	int location[30],result;
	//input data
	CHECK_ARG_NAME("str","findFIO");
	readString(istream,str,81);
	CHECK_ARG_NAME("surname","findFIO");
	readString(istream,surname,21);

	//execute test
	GUARD_CALL(result=_142d2_findFIO(str,surname,location))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,30,_ERROR_WRONG_ARRAY_SIZE,"location","findFIO","0","30");
	CHECK_INT_ARRAY_LIMITS(location,result,0,strlen(str)-strlen(surname),"location","findFIO","0","string length minus surname length");
	//output results
	writeOutArg(ostream,"location");
	writeInt1D(ostream,location,result);
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 17///////////////////////////////////////////////////////////////////////////
int _test_17_reverseWords(FILE *istream, FILE *ostream)
{
	char str[81],word[21];
	//input data
	CHECK_ARG_NAME("str","reverseWords");
	readString(istream,str,81);
	CHECK_ARG_NAME("word","reverseWords");
	readString(istream,word,21);

	//execute test
	GUARD_CALL(_17_reverseWords(str,word))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","reverseWords");
	//output results
	writeOutArg(ostream,"str");
	writeString(ostream,str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//17mod6
int _test_a7490_reverseWordsInText(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int strCount;
	char word[21];
	//input data
	CHECK_ARG_NAME("text","reverseWordsInText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","reverseWordsInText");
	strCount=readInt(istream);
	CHECK_ARG_NAME("word","reverseWordsInText");
	readString(istream,word,21);

	//execute test
	GUARD_CALL(_a7490_reverseWordsInText(text,strCount,word))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,strCount,"text","reverseWordsInText");
	//output results
	writeOutArg(ostream,"text");
	writeChar2D<20,81>(ostream,text,strCount);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//17mod7
int _test_f3c74_reversePhrase(FILE *istream, FILE *ostream)
{
	char str[81],word1[21],word2[21];
	//input data
	CHECK_ARG_NAME("str","reversePhrase");
	readString(istream,str,81);
	CHECK_ARG_NAME("word1","reversePhrase");
	readString(istream,word1,21);
	CHECK_ARG_NAME("word2","reversePhrase");
	readString(istream,word2,21);

	//execute test
	GUARD_CALL(_f3c74_reversePhrase(str,word1,word2))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","reversePhrase");
	//output results
	writeOutArg(ostream,"str");
	writeString(ostream,str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}//17mod8
int _test_05789_reversePhraseInText(FILE *istream, FILE *ostream)
{
	char text[20][81],word1[21],word2[21];
	int strCount;
	//input data
	CHECK_ARG_NAME("text","reversePhraseInText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","reversePhraseInText");
	strCount=readInt(istream);
	CHECK_ARG_NAME("word1","reversePhraseInText");
	readString(istream,word1,21);
	CHECK_ARG_NAME("word2","reversePhraseInText");
	readString(istream,word2,21);

	//execute test
	GUARD_CALL(_05789_reversePhraseInText(text,strCount,word1,word2))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,strCount,"text","reversePhraseInText");
	//output results
	writeOutArg(ostream,"text");
	writeChar2D<20,81>(ostream,text,strCount);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 18///////////////////////////////////////////////////////////////////////////

int _test_18_deleteWords(FILE *istream, FILE *ostream)
{
	char str[81], word[21];
	//input data
	CHECK_ARG_NAME("str","deleteWords");
	readString(istream,str,81);
	CHECK_ARG_NAME("word","deleteWords");
	readString(istream,word,21);

	//execute test
	GUARD_CALL(_18_deleteWords(str,word))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","deleteWords");
	//output results
	writeOutArg(ostream,"str");
	writeString(ostream,str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//18mod6
int _test_3eac1_deleteWordsFromText(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int strCount;
	char word[21];
	//input data
	CHECK_ARG_NAME("text","deleteWordsFromText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","deleteWordsFromText");
	strCount=readInt(istream);
	CHECK_ARG_NAME("word","deleteWordsFromText");
	readString(istream,word,21);

	//execute test
	GUARD_CALL(_3eac1_deleteWordsFromText(text,strCount,word))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,strCount,"text","deleteWordsFromText");
	//output results
	writeOutArg(ostream,"text");
	writeChar2D<20,81>(ostream,text,strCount);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//18mod7
int _test_1af88_deleteString(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int strCount,index,result;
	//input data
	CHECK_ARG_NAME("text","deleteString");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","deleteString");
	strCount=readInt(istream);
	CHECK_ARG_NAME("index","deleteString");
	index=readInt(istream);

	//execute test
	GUARD_CALL(result=_1af88_deleteString(text,strCount,index))

	//check results for integrity
	CHECK_INT_LIMITS(result,strCount-1,strCount-1,_ERROR_WRONG_RETURN_VALUE,"returned","deleteString","strings count minus 1","strings count minus 1");
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,result,"text","deleteString");
	//output results
	writeOutArg(ostream,"text");
	writeChar2D<20,81>(ostream,text,result);
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//18mod8
int _test_50b16_deleteDuplicateWordsFromText(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int strCount;
	//input data
	CHECK_ARG_NAME("text","deleteDuplicateWordsFromText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","deleteDuplicateWordsFromText");
	strCount=readInt(istream);

	//execute test
	GUARD_CALL(_50b16_deleteDuplicateWordsFromText(text,strCount))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,strCount,"text","deleteDuplicateWordsFromText");
	//output results
	writeOutArg(ostream,"text");
	writeChar2D<20,81>(ostream,text,strCount);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 19///////////////////////////////////////////////////////////////////////////
int _test_19_toMorseCode(FILE *istream, FILE *ostream)
{
	char character;
	char MorseCode[7];
	//input data
	CHECK_ARG_NAME("character","toMorseCode");
	character=readChar(istream);

	//execute test
	GUARD_CALL(_19_toMorseCode(character,MorseCode))

	//check results for integrity
	ENSURE_END_OF_STRING(MorseCode,7,"MorseCode","toMorseCode");
	//output results
	writeOutArg(ostream,"MorseCode");
	writeString(ostream,MorseCode);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_19_strToMorse(FILE *istream, FILE *ostream)
{
	char str[81];
	char MorseCode[324];
	//input data
	CHECK_ARG_NAME("str","strToMorse");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(_19_strToMorse(str,MorseCode))

	//check results for integrity
	ENSURE_END_OF_STRING(MorseCode,324,"MorseCode","strToMorse");
	//output results
	writeOutArg(ostream,"MorseCode");
	writeString(ostream,MorseCode);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
///////variant 19 mod 6 
int _test_f3342_translateText(FILE *istream, FILE *ostream)
{
	char text[20][324];
	char strCount;
	//input data
	CHECK_ARG_NAME("text","translateText");
	readChar2D<20,324>(istream,text);
	CHECK_ARG_NAME("strCount","translateText");
	strCount=readInt(istream);

	//execute test
	GUARD_CALL(_f3342_translateText(text,strCount))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(text,20,324,strCount,"text","translateText");
	//output results
	writeOutArg(ostream,"text");
	writeChar2D<20,324>(ostream,text,strCount);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//19mod7
int _test_fc6a9_translateSubstrings(FILE *istream, FILE *ostream)
{
	char str[81],substrings[20][31];
	int substrCount;
	//input data
	CHECK_ARG_NAME("str","translateSubstrings");
	readString(istream,str,81);
	CHECK_ARG_NAME("substrings","translateSubstrings");
	readChar2D<20,31>(istream,substrings);
	CHECK_ARG_NAME("substrCount","translateSubstrings");
	substrCount=readInt(istream);

	//execute test
	GUARD_CALL(_fc6a9_translateSubstrings(str,substrings,substrCount))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","translateSubstrings");
	//output results
	writeOutArg(ostream,"str");
	writeString(ostream,str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//19mod8
int _test_fa4a6_translateFromMorseCode(FILE *istream, FILE *ostream)
{
	char strMorseCode[324],str[81];
	//input data
	CHECK_ARG_NAME("strMorseCode","translateFromMorseCode");
	readString(istream,strMorseCode,324);
	
	//execute test
	GUARD_CALL(_fa4a6_translateFromMorseCode(strMorseCode,str))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","translateFromMorseCode");
	//output results
	writeOutArg(ostream,"str");
	writeString(ostream,str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 20///////////////////////////////////////////////////////////////////////////
int _test_20_searchPhrase(FILE *istream, FILE *ostream)
{
	char text[20][81], phrase[41], buffer[50];
	int strCount, result, location[40][2];
	//input data
	CHECK_ARG_NAME("text","searchPhrase");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","searchPhrase");
	strCount=readInt(istream);
	CHECK_ARG_NAME("phrase","searchPhrase");
	readString(istream, phrase, 41);

	//execute test
	GUARD_CALL(result=_20_searchPhrase(text,strCount,phrase,location))
	
	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_ARRAY_SIZE,"location","searchPhrase","0","40");
	CHECK_LOCATIONS_IN2D(text,strCount,location,result,"location","searchPhrase",0);
	//output results
	writeOutArg(ostream, "location");
	writeInt2D<40,2>(ostream, location,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//20mod6
int _test_6a4eb_searchWordInText(FILE *istream, FILE *ostream)
{
	char text[20][81], word[21], buffer[50];
	int strCount, result, location[40][2];
	//input data
	CHECK_ARG_NAME("text","searchWordInText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","searchWordInText");
	strCount=readInt(istream);
	CHECK_ARG_NAME("word","searchWordInText");
	readString(istream, word, 21);

	//execute test
	GUARD_CALL(result=_6a4eb_searchWordInText(text,strCount,word,location))
	
	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_ARRAY_SIZE,"location","searchWordInText","0","40");
	CHECK_LOCATIONS_IN2D(text,strCount,location,result,"location","searchWordInText",0);
	//output results
	writeOutArg(ostream, "location");
	writeInt2D<40,2>(ostream, location,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//20mod7
int _test_024d7_searchWordInText(FILE *istream, FILE *ostream)
{
	char text[20][81], word[21];
	int strCount, direction, location[2];
	//input data
	CHECK_ARG_NAME("text","searchWordInText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","searchWordInText");
	strCount=readInt(istream);
	CHECK_ARG_NAME("word","searchWordInText");
	readString(istream, word, 21);
	CHECK_ARG_NAME("direction","searchWordInText");
	direction=readInt(istream);
	CHECK_ARG_NAME("location","searchWordInText");
	readInt1D(istream,location,2);

	//execute test
	GUARD_CALL(_024d7_searchWordInText(text,strCount,word,direction,location))
	
	//check results for integrity
	CHECK_LOCATION_IN2D(text,strCount,location,"location[0]","location[1]","searchWordInText",-1);
	//output results
	writeOutArg(ostream, "location");
	writeInt1D(ostream,location,2);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//20mod8
int _test_04ca43_searchPhrase(FILE *istream, FILE *ostream)
{
	char text[20][81], phrase[20][41], buffer[50];
	int strCount, wordCount, result, location[40][2];
	//input data
	CHECK_ARG_NAME("text","searchPhrase");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","searchPhrase");
	strCount=readInt(istream);
	CHECK_ARG_NAME("phrase","searchPhrase");
	readChar2D<20,41>(istream,phrase);
	CHECK_ARG_NAME("wordCount","searchPhrase");
	wordCount=readInt(istream);
	
	//execute test
	GUARD_CALL(result=_04ca43_searchPhrase(text,strCount,phrase,wordCount,location))
	
	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_ARRAY_SIZE,"location","searchPhrase","0","40");
	CHECK_LOCATIONS_IN2D(text,strCount,location,result,"location","searchPhrase",0);
	//output results
	writeOutArg(ostream, "location");
	writeInt2D<40,2>(ostream, location,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 21///////////////////////////////////////////////////////////////////////////
int _test_21_replaceWords(FILE *istream, FILE *ostream)
{
	char str[81], originalWord[21], targetWord[21];
	//input data
	CHECK_ARG_NAME("str","replaceWords");
	readString(istream, str, 81);
	CHECK_ARG_NAME("originalWord","replaceWords");
	readString(istream, originalWord, 21);
	CHECK_ARG_NAME("targetWord","replaceWords");
	readString(istream, targetWord, 21);

	//execute test
	GUARD_CALL(_21_replaceWords(str,originalWord,targetWord))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","replaceWords");
	//output results
	writeOutArg(ostream, "str");
	writeString(ostream,str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//21mod6
int _test_d2e14_replaceWordsInText(FILE *istream, FILE *ostream)
{
	char text[20][81], originalWord[21], targetWord[21];
	int strCount;
	//input data
	CHECK_ARG_NAME("text","replaceWordsInText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","replaceWordsInText");
	strCount=readInt(istream);
	CHECK_ARG_NAME("originalWord","replaceWords");
	readString(istream, originalWord, 21);
	CHECK_ARG_NAME("targetWord","replaceWords");
	readString(istream, targetWord, 21);

	//execute test
	GUARD_CALL(_d2e14_replaceWordsInText(text,strCount,originalWord,targetWord))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,strCount,"text","replaceWords");
	//output results
	writeOutArg(ostream, "text");
	writeChar2D<20,81>(ostream,text,strCount);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//21mod8
int _test_e3a83_insertStringToText(FILE *istream, FILE *ostream)
{
	char text[20][81],substr[21];
	int strCount,result,location[2];
	//input data
	CHECK_ARG_NAME("text","insertStringToText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","insertStringToText");
	strCount=readInt(istream);
	CHECK_ARG_NAME("location","insertStringToText");
	readInt1D(istream,location,2);

	//execute test
	GUARD_CALL(result=_e3a83_insertStringToText(text,strCount,location,substr))

	//check results for integrity
	CHECK_INT_LIMITS(result,strCount,20,_ERROR_WRONG_ARRAY_SIZE,"text","insertStringToText","strings count","20");
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,result,"text","insertStringToText");
	//output results
	writeOutArg(ostream, "text");
	writeChar2D<20,81>(ostream,text,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 22///////////////////////////////////////////////////////////////////////////
int _test_22_stringToSubstrings(FILE *istream, FILE *ostream)
{
	char str[81], separators[31];
	char *substrings[30][2];
	wordPointer1D wps[30];
	int i,result;
	//input data
	CHECK_ARG_NAME("str","stringToSubstrings");
	readString(istream,str,81);
	CHECK_ARG_NAME("separators","stringToSubstrings");
	readString(istream,separators,31);

	//execute test
	GUARD_CALL(result=_22_stringToSubstrings(str,separators,substrings))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,30,_ERROR_WRONG_ARRAY_SIZE,"substrings","stringToSubstrings","0","30");
	WPTR1_FROM_PTR_PAIR(wps,str,result,substrings);
	//output results
	writeOutArg(ostream, wordPointer1D::arg_title);
	writePointer1D<wordPointer1D>(ostream,wps,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_22_countRepeats(FILE *istream, FILE *ostream)
{
	char str[81], separators[31];
	char *substrings[30][2];
	int countSubstrings, result;
	int startpos;
	fprintf(ostream,_DEPENDENT_TESTING,"stringToSubstrings");
	//input data
	CHECK_ARG_NAME("str","countRepeats");
	readString(istream,str,81);
	CHECK_ARG_NAME("separators","countRepeats");
	readString(istream,separators,31);
	GUARD_CALL(countSubstrings=_22_stringToSubstrings(str,separators,substrings))
	CHECK_INT_LIMITS(countSubstrings,0,30,_ERROR_WRONG_ARRAY_SIZE,"substrings","stringToSubstrings","0","30");
	CHECK_ARG_NAME("startpos","countRepeats");
	startpos=readInt(istream);

	//execute test
	GUARD_CALL(result=_22_countRepeats(str,substrings,countSubstrings,str+startpos))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,countSubstrings,_ERROR_WRONG_RETURN_VALUE,"returned","countRepeats","0","substrings count");
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	//output results
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//22mod6
int _test_235bc_iterativeWordCount(FILE *istream, FILE *ostream)
{
	char str[81],separators[31];
	int separator, result;
	//input data
	CHECK_ARG_NAME("str","iterativeWordCount");
	readString(istream,str,81);
	CHECK_ARG_NAME("separators","iterativeWordCount");
	readString(istream,separators,31);
	CHECK_ARG_NAME("separator","iterativeWordCount");
	separator=readInt(istream);

	//execute test
	GUARD_CALL(result=_235bc_iterativeWordCount(str,separators,separator))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_RETURN_VALUE,"returned","iterativeWordCount","0","40");
	//output results
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}//22mod7
int _test_a4eb3_iterativeWordLocation(FILE *istream, FILE *ostream)
{
	char text[20][81],buffer[50];
	int strCount, result, location[40][2];
	int i; 
	//input data
	CHECK_ARG_NAME("text","iterativeWordLocation");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","iterativeWordLocation");
	strCount=readInt(istream);

	//execute test
	GUARD_CALL(result=_a4eb3_iterativeWordLocation(text,strCount,location))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_ARRAY_SIZE,"location","iterativeWordLocation","0","40");
	CHECK_LOCATIONS_IN2D(text,strCount,location,result,"location","iterativeWordLocation",0);
	//output results
	writeOutArg(ostream, "location");
	writeInt2D<40,2>(ostream, location,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//22mod8
int _test_fcb68_sentenceLocation(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int result,strCount,location[40][2];
	//input data
	CHECK_ARG_NAME("text","sentenceLocation");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","sentenceLocation");
	strCount=readInt(istream);

	//execute test
	GUARD_CALL(result=_fcb68_sentenceLocation(text,strCount,location))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_ARRAY_SIZE,"location","sentenceLocation","0","40");
	CHECK_LOCATIONS_IN2D(text,strCount,location,result,"location","sentenceLocation",0);
	//output results
	writeOutArg(ostream, "location");
	writeInt2D<40,2>(ostream, location,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 23///////////////////////////////////////////////////////////////////////////
int _test_23_wordMeaning(FILE *istream, FILE *ostream)
{
	char str[81],word[21],satellites[5][21];
	int range, result;
	//input data
	CHECK_ARG_NAME("str","wordMeaning");
	readString(istream,str,81);
	CHECK_ARG_NAME("word","wordMeaning");
	readString(istream,word,21);
	CHECK_ARG_NAME("satellites","wordMeaning");
	readChar2D<5,21>(istream,satellites);
	CHECK_ARG_NAME("range","wordMeaning");
	range=readInt(istream);

	//execute test
	GUARD_CALL(result=_23_wordMeaning(str,word,satellites,range))

	//check results for integrity
	CHECK_INT_LIMITS(result,-1,4,_ERROR_WRONG_RETURN_VALUE,"returned","wordMeaning","-1","4");
	//output results
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_23_strToWords(FILE *istream, FILE *ostream)
{
	char str[81];
	char *words[40][2];
	int result,i;
	wordPointer1D wps[40];
	//input data
	CHECK_ARG_NAME("str","strToWords");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(result=_23_strToWords(str,words))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_ARRAY_SIZE,"words","strToWords","0","40");
	WPTR1_FROM_PTR_PAIR(wps,str,result,words);
	//output results
	writeOutArg(ostream, wordPointer1D::arg_title);
	writePointer1D<wordPointer1D>(ostream,wps,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//23mod6
int _test_b40a3_distanceBetweenWords(FILE *istream, FILE *ostream)
{
	char str[81], word1[21], word2[21];
	int result;
	//input data
	CHECK_ARG_NAME("str","distanceBetweenWords");
	readString(istream,str,81);
	CHECK_ARG_NAME("word1","distanceBetweenWords");
	readString(istream,word1,21);
	CHECK_ARG_NAME("word2","distanceBetweenWords");
	readString(istream,word2,21);

	//execute test
	GUARD_CALL(result=_b40a3_distanceBetweenWords(str,word1,word2))

	//check results for integrity
	CHECK_INT_LIMITS(result,-1,40,_ERROR_WRONG_RETURN_VALUE,"returned","distanceBetweenWords","-1","40");
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	//output results
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//23mod7
int _test_24cb3_getWords(FILE *istream, FILE *ostream)
{
	char str[81], selectedWords[20][21];
	int startIndex, endIndex, result;
	//input data
	CHECK_ARG_NAME("str","getWords");
	readString(istream,str,81);
	CHECK_ARG_NAME("startIndex","getWords");
	startIndex=readInt(istream);
	CHECK_ARG_NAME("endIndex","getWords");
	endIndex=readInt(istream);

	//execute test
	GUARD_CALL(result=_24cb3_getWords(str,startIndex,endIndex,selectedWords))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,20,_ERROR_WRONG_ARRAY_SIZE,"selectedWords","getWords","0","20");
	ENSURE_END_OF_STRING_IN_TEXT(selectedWords,20,21,result,"selectedWords","getWords");
	//output results
	writeOutArg(ostream, "selectedWords");
	writeChar2D<20,21>(ostream,selectedWords,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//23mod8
int _test_63e44_separateToSentences(FILE *istream, FILE *ostream)
{
	char str[81],sentences[20][81];
	int result;
	//input data
	CHECK_ARG_NAME("str","separateToSentences");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(result=_63e44_separateToSentences(str,sentences))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,20,_ERROR_WRONG_ARRAY_SIZE,"sentences","separateToSentences","0","20");
	ENSURE_END_OF_STRING_IN_TEXT(sentences,20,81,result,"sentences","separateToSentences");
	//output results
	writeOutArg(ostream, "sentences");
	writeChar2D<20,81>(ostream,sentences,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 24///////////////////////////////////////////////////////////////////////////
int _test_24_stringInText(FILE *istream, FILE *ostream)
{
	char text[20][81], str[81];
	int strCount, lineIndex, colIndex;
	//input data
	CHECK_ARG_NAME("text","stringInText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","stringInText");
	strCount=readInt(istream);
	CHECK_ARG_NAME("str","stringInText");
	readString(istream,str,81);
	CHECK_ARG_NAME("lineIndex","stringInText");
	lineIndex=readInt(istream);
	CHECK_ARG_NAME("colIndex","stringInText");
	colIndex=readInt(istream);

	//execute test
	GUARD_CALL(_24_stringInText(text,strCount,str,&lineIndex,&colIndex))

	//check results for integrity
	CHECK_INT_LIMITS(lineIndex,-1,strCount,_ERROR_WRONG_RETURN_ARG,"lineIndex","stringInText","-1","strings count");
	if(lineIndex>-1)
	{
		ENSURE_POINTER_IN_STRING(text[lineIndex],text[lineIndex]+colIndex,"text","colIndex","stringInText");
	}
	else
	{
		CHECK_INT_LIMITS(colIndex,-1,-1,_ERROR_WRONG_RETURN_ARG,"colIndex","stringInText","-1","-1");
	}
	//output results
	writeOutArg(ostream, "lineIndex");
	writeInt(ostream,lineIndex);
	writeOutArg(ostream, "colIndex");
	writeInt(ostream,colIndex);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//24mod6
int _test_65b6e_stringInTextAll(FILE *istream, FILE *ostream)
{
	char text[20][81], str[81], buffer[50];
	int strCount, result, i, location[20][2];
	//input data
	CHECK_ARG_NAME("text","stringInTextAll");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("strCount","stringInTextAll");
	strCount=readInt(istream);
	CHECK_ARG_NAME("str","stringInTextAll");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(result=_65b6e_stringInTextAll(text,strCount,str,location))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,20,_ERROR_WRONG_ARRAY_SIZE,"location","stringInTextAll","0","20");
	CHECK_LOCATIONS_IN2D(text,strCount,location,result,"location","stringInTextAll",0);
	//output results
	writeOutArg(ostream, "location");
	writeInt2D<20,2>(ostream,location,result);
	writeOutArg(ostream, "return");
	writeInt(ostream,result);	
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//24mod7
int _test_84c95_delRegionOfText(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int count, region[4];
	//input data
	CHECK_ARG_NAME("text","delRegionOfText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("count","delRegionOfText");
	count=readInt(istream);
	CHECK_ARG_NAME("region","delRegionOfText");
	readInt1D(istream,region,4);

	//execute test
	GUARD_CALL(_84c95_delRegionOfText(text,count,region))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,count,"text","delRegionOfText");
	//output results
	writeOutArg(ostream, "text");
	writeChar2D<20,81>(ostream,text,count);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//24mod8&9
int _test_8eb83_appendString(FILE *istream, FILE *ostream)
{
	char destinationStr[81],sourceStr[81],excessive[81];
	int place;
	//input data
	CHECK_ARG_NAME("destinationStr","appendString");
	readString(istream,destinationStr,81);
	CHECK_ARG_NAME("sourceStr","appendString");
	readString(istream,sourceStr,81);
	CHECK_ARG_NAME("place","appendString");
	place=readInt(istream);

	//execute test
	GUARD_CALL(_8eb83_appendString(destinationStr,sourceStr,place,excessive))

	//check results for integrity
	ENSURE_END_OF_STRING(destinationStr,81,"destinationStr","appendString");
	ENSURE_END_OF_STRING(excessive,81,"excessive","appendString");
	//output results
	writeOutArg(ostream, "destinationStr");
	writeString(ostream,destinationStr);
	writeOutArg(ostream, "excessive");
	writeString(ostream,excessive);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 25///////////////////////////////////////////////////////////////////////////
int _test_25_parseSynonym(FILE *istream, FILE *ostream)
{
	char synonym[61];
	char synonymDictionary[2][31];
	int result;
	//input data
	CHECK_ARG_NAME("synonym","parseSynonym");
	readString(istream,synonym,61);

	//execute test
	GUARD_CALL(result=_25_parseSynonym(synonym,synonymDictionary))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,1,_ERROR_WRONG_RETURN_VALUE,"returned","parseSynonym","0","1");
	if(result)
	{
		ENSURE_END_OF_STRING(synonymDictionary[0],31,"synonymDictionary[0]","parseSynonym");
		ENSURE_END_OF_STRING(synonymDictionary[1],31,"synonymDictionary[0]","parseSynonym");
	}
	//output results
	writeOutArg(ostream,"synonymDictionary");
	if(result)
		writeChar2D<2,31>(ostream,synonymDictionary,2);
	else
		writeString(ostream,"|||wrong synonym format|||");
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_25_findSynonym(FILE *istream, FILE *ostream)
{
	char synonymDictionary[20][2][31];
	int count;
	char word[31];
	char synonym[31];
	//input data
	CHECK_ARG_NAME("synonymDictionary","findSynonym");
	readChar3D<20,2,31>(istream,synonymDictionary);
	CHECK_ARG_NAME("count","findSynonym");
	count=readInt(istream);
	CHECK_ARG_NAME("word","findSynonym");
	readString(istream,word,31);

	//execute test
	GUARD_CALL(_25_findSynonym(synonymDictionary,count,word,synonym))

	//check results for integrity
	ENSURE_END_OF_STRING(synonym,31,"synonym","findSynonym");
	//output results
	writeOutArg(ostream,"synonym");
	writeString(ostream,synonym);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
///////variant 25 mod 6 
int _test_20579_findSynonymAll(FILE *istream, FILE *ostream)
{
	char synonymDictionary[20][2][31];
	int count,result;
	char word[31];
	char synonyms[20][31];
	//input data
	CHECK_ARG_NAME("synonymDictionary","findSynonymAll");
	readChar3D<20,2,31>(istream,synonymDictionary);
	CHECK_ARG_NAME("count","findSynonymAll");
	count=readInt(istream);
	CHECK_ARG_NAME("word","findSynonymAll");
	readString(istream,word,31);

	//execute test
	GUARD_CALL(result=_20579_findSynonymAll(synonymDictionary,count,word,synonyms))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,20,_ERROR_WRONG_ARRAY_SIZE,"synonyms","findSynonymAll","0","20");
	ENSURE_END_OF_STRING_IN_TEXT(synonyms,20,31,result,"synonyms","findSynonymAll");
	//output results
	writeOutArg(ostream,"synonyms");
	writeChar2D<20,31>(ostream,synonyms,result);
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//25mod7
int _test_d9542_synonymString(FILE *istream, FILE *ostream)
{
	char synonymDictionary[20][2][31],sourceStr[81],resultStr[81];
	int count;
	//input data
	CHECK_ARG_NAME("synonymDictionary","synonymString");
	readChar3D<20,2,31>(istream,synonymDictionary);
	CHECK_ARG_NAME("count","synonymString");
	count=readInt(istream);
	CHECK_ARG_NAME("sourceStr","synonymString");
	readString(istream,sourceStr,81);

	//execute test
	GUARD_CALL(_d9542_synonymString(synonymDictionary,count,sourceStr,resultStr))

	//check results for integrity
	ENSURE_END_OF_STRING(resultStr,81,"resultStr","synonymString");
	//output results
	writeOutArg(ostream,"resultStr");
	writeString(ostream,resultStr);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//25mod8
int _test_2ae89_addSynonyms(FILE *istream, FILE *ostream)
{
	char synonymDictionary[20][2][31], str[81];
	int count;
	//input data
	CHECK_ARG_NAME("synonymDictionary","addSynonyms");
	readChar3D<20,2,31>(istream,synonymDictionary);
	CHECK_ARG_NAME("count","addSynonyms");
	count=readInt(istream);
	CHECK_ARG_NAME("str","addSynonyms");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(_2ae89_addSynonyms(synonymDictionary,count,str))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","addSynonyms");
	//output results
	writeOutArg(ostream,"str");
	writeString(ostream,str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 26///////////////////////////////////////////////////////////////////////////
int _test_26_findString(FILE *istream, FILE *ostream)
{
	char stringList[20][21], str[21];
	int count, result;
	//input data
	CHECK_ARG_NAME("stringList","findString");
	readChar2D<20,21>(istream,stringList);
	CHECK_ARG_NAME("count","findString");
	count=readInt(istream);
	CHECK_ARG_NAME("str","findString");
	readString(istream,str,21);

	//execute test
	GUARD_CALL(result=_26_findString(stringList,count,str))

	//check results for integrity
	CHECK_INT_LIMITS(result,-1,20,_ERROR_WRONG_RETURN_VALUE,"returned","findString","-1","20");
	//output results
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//26mod6
int _test_54ded_spellString(FILE *istream, FILE *ostream)
{
	char str[81], dictionary[20][21];
	int count, result;
	//input data
	CHECK_ARG_NAME("str","spellString");
	readString(istream,str,81);
	CHECK_ARG_NAME("dictionary","spellString");
	readChar2D<20,21>(istream,dictionary);
	CHECK_ARG_NAME("count","spellString");
	count=readInt(istream);

	//execute test
	GUARD_CALL(result=_54ded_spellString(str,dictionary,count))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,40,_ERROR_WRONG_RETURN_VALUE,"returned","spellString","0","40");
	//output results
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//26mod7
int _test_e82bb_checkSpelling(FILE *istream, FILE *ostream)
{
	char dictionary[20][21], str[81], checkedString[81];
	int count;
	//input data
	CHECK_ARG_NAME("dictionary","checkSpelling");
	readChar2D<20,21>(istream,dictionary);
	CHECK_ARG_NAME("count","checkSpelling");
	count=readInt(istream);
	CHECK_ARG_NAME("str","checkSpelling");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(_e82bb_checkSpelling(dictionary,count,str,checkedString))

	//check results for integrity
	ENSURE_END_OF_STRING(checkedString,81,"checkedString","checkSpelling");
	//output results
	writeOutArg(ostream,"checkedString");
	writeString(ostream,checkedString);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//26mod8
int _test_0a49d_fixSpelling(FILE *istream, FILE *ostream)
{
	char dictionary[20][21], str[81];
	int count, result;
	//input data
	CHECK_ARG_NAME("dictionary","fixSpelling");
	readChar2D<20,21>(istream,dictionary);
	CHECK_ARG_NAME("count","fixSpelling");
	count=readInt(istream);
	CHECK_ARG_NAME("str","fixSpelling");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(result=_0a49d_fixSpelling(dictionary,count,str))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,1,_ERROR_WRONG_RETURN_VALUE,"returned","fixSpelling","0","1");
	ENSURE_END_OF_STRING(str,81,"str","fixSpelling");
	//output results
	writeOutArg(ostream,"str");
	writeString(ostream,str);
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 27///////////////////////////////////////////////////////////////////////////
int _test_27_findWord(FILE *istream, FILE *ostream)
{
	char divisionOfWords[20][2][31], word[21];
	int count,result;
	//input data
	CHECK_ARG_NAME("divisionOfWords","findWord");
	readChar3D<20,2,31>(istream,divisionOfWords);
	CHECK_ARG_NAME("count","findWord");
	count=readInt(istream);
	CHECK_ARG_NAME("word","findWord");
	readString(istream,word,21);

	//execute test
	GUARD_CALL(result=_27_findWord(divisionOfWords,count,word))

	//check results for integrity
	CHECK_INT_LIMITS(result,-1,20,_ERROR_WRONG_RETURN_VALUE,"returned","findWord","-1","20");
	//output results
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
int _test_27_divideWord(FILE *istream, FILE *ostream)
{
	char divisionOfWord[31];
	int n, result;
	//input data
	CHECK_ARG_NAME("divisionOfWord","divideWord");
	readString(istream,divisionOfWord,31);
	CHECK_ARG_NAME("n","divideWord");
	n=readInt(istream);

	//execute test
	GUARD_CALL(result=_27_divideWord(divisionOfWord,n))

	//check results for integrity
	CHECK_INT_LIMITS(result,-2,30,_ERROR_WRONG_RETURN_VALUE,"returned","divideWord","-2","30");
	//output results
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//27mod6
int _test_27cd9_divisionOfWordInDictionary(FILE *istream, FILE *ostream)
{
	char divisionOfWords[20][2][31], word[21];
	int count,result,n, hyphenIndex;
	//input data
	CHECK_ARG_NAME("divisionOfWords","divisionOfWordInDictionary");
	readChar3D<20,2,31>(istream,divisionOfWords);
	CHECK_ARG_NAME("count","divisionOfWordInDictionary");
	count=readInt(istream);
	CHECK_ARG_NAME("word","divisionOfWordInDictionary");
	readString(istream,word,21);
	CHECK_ARG_NAME("n","divisionOfWordInDictionary");
	n=readInt(istream);

	//execute test
	GUARD_CALL(result=_27cd9_divisionOfWordInDictionary(divisionOfWords,count,word,n,&hyphenIndex))

	//check results for integrity
	CHECK_INT_LIMITS(result,-1,20,_ERROR_WRONG_RETURN_VALUE,"returned","divideWord","-1","20");
	CHECK_INT_LIMITS(hyphenIndex,-1,30,_ERROR_WRONG_RETURN_ARG,"hyphenIndex","divideWord","-1","30");
	//output results
	writeOutArg(ostream,"hyphenIndex");
	writeInt(ostream,hyphenIndex);
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//27mod7&8
int _test_bb159_divideString(FILE *istream, FILE *ostream)
{
	char divisionOfWords[20][2][31], str[81];
	int count,maxLength;
	//input data
	CHECK_ARG_NAME("divisionOfWords","divideString");
	readChar3D<20,2,31>(istream,divisionOfWords);
	CHECK_ARG_NAME("count","divideString");
	count=readInt(istream);
	CHECK_ARG_NAME("str","divideString");
	readString(istream,str,81);
	CHECK_ARG_NAME("maxLength","divideString");
	maxLength=readInt(istream);

	//execute test
	GUARD_CALL(_bb159_divideString(divisionOfWords,count,str,maxLength))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","divideString");
	//output results
	writeOutArg(ostream,"str");
	writeString(ostream,str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 28///////////////////////////////////////////////////////////////////////////
//28mod6
int _test_ce079_insertFirstLineIndent(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int count;
	//input data
	CHECK_ARG_NAME("text","insertFirstLineIndent");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("count","insertFirstLineIndent");
	count=readInt(istream);

	//execute test
	GUARD_CALL(_ce079_insertFirstLineIndent(text,count))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,count,"text","insertFirstLineIndent");
	//output results
	for(int i=0;i<count;i++)//set leading spaces to '*' to make testing easier
		for(int j=0;text[i][j]==' ';j++)
			text[i][j]='*';
	writeOutArg(ostream,"text");
	writeChar2D<20,81>(ostream,text,count);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//28mod7
int _test_d26a2_insertEmptyString(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int count, index, result;
	//input data
	CHECK_ARG_NAME("text","insertEmptyString");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("count","insertEmptyString");
	count=readInt(istream);
	CHECK_ARG_NAME("index","insertEmptyString");
	index=readInt(istream);

	//execute test
	GUARD_CALL(result=_d26a2_insertEmptyString(text,count,index))

	//check results for integrity
	CHECK_INT_LIMITS(result,count+1,count+1,_ERROR_WRONG_ARRAY_SIZE,"text","insertEmptyString","strings count plus 1","strings count plus 1");
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,result,"text","insertEmptyString");
	//output results
	writeOutArg(ostream,"text");
	writeChar2D<20,81>(ostream,text,result);
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//28mod8
int _test_df735_insertString(FILE *istream, FILE *ostream)
{
	char text[20][81], str[81];
	int count, index, result;
	//input data
	CHECK_ARG_NAME("text","insertString");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("count","insertString");
	count=readInt(istream);
	CHECK_ARG_NAME("index","insertString");
	index=readInt(istream);
	CHECK_ARG_NAME("str","insertString");
	readString(istream,str,81);

	//execute test
	GUARD_CALL(result=_df735_insertString(text,count,index,str))

	//check results for integrity
	CHECK_INT_LIMITS(result,count+1,count+1,_ERROR_WRONG_ARRAY_SIZE,"text","insertString","strings count plus 1","strings count plus 1");
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,result,"text","insertString");
	//output results
	writeOutArg(ostream,"text");
	writeChar2D<20,81>(ostream,text,result);
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 29///////////////////////////////////////////////////////////////////////////
int _test_29_distanceBetweenWords(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int count, result, locationWord1[2], locationWord2[2];
	//input data
	CHECK_ARG_NAME("text","distanceBetweenWords");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("count","distanceBetweenWords");
	count=readInt(istream);
	CHECK_ARG_NAME("locationWord1","distanceBetweenWords");
	readInt1D(istream,locationWord1,2);
	CHECK_ARG_NAME("locationWord2","distanceBetweenWords");
	readInt1D(istream,locationWord2,2);

	//execute test
	GUARD_CALL(result=_29_distanceBetweenWords(text,count,locationWord1,locationWord2))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,1600,_ERROR_WRONG_RETURN_VALUE,"returned","distanceBetweenWords","0","1600");
	//output results
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//29mod6
int _test_10c6c_distanceBetweenWordsValue(FILE *istream, FILE *ostream)
{
	char text[20][81], word1[21], word2[21];
	int count, result;
	//input data
	CHECK_ARG_NAME("text","distanceBetweenWordsValue");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("count","distanceBetweenWordsValue");
	count=readInt(istream);
	CHECK_ARG_NAME("word1","distanceBetweenWordsValue");
	readString(istream,word1,21);
	CHECK_ARG_NAME("word2","distanceBetweenWordsValue");
	readString(istream,word2,21);

	//execute test
	GUARD_CALL(result=_10c6c_distanceBetweenWordsValue(text,count,word1,word2))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,1600,_ERROR_WRONG_RETURN_VALUE,"returned","distanceBetweenWords","0","1600");
	//output results
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//29mod7
int _test_5ebf2_fillLettersAndNumbers(FILE *istream, FILE *ostream)
{
	char text[20][81];
	int count, result, locationWord1[2], locationWord2[2];
	//input data
	CHECK_ARG_NAME("text","fillLettersAndNumbers");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("count","fillLettersAndNumbers");
	count=readInt(istream);
	CHECK_ARG_NAME("locationWord1","fillLettersAndNumbers");
	readInt1D(istream,locationWord1,2);
	CHECK_ARG_NAME("locationWord2","fillLettersAndNumbers");
	readInt1D(istream,locationWord2,2);

	//execute test
	GUARD_CALL(result=_5ebf2_fillLettersAndNumbers(text,count,locationWord1,locationWord2))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,1600,_ERROR_WRONG_RETURN_VALUE,"returned","fillLettersAndNumbers","0","1600");
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,count,"text","fillLettersAndNumbers");
	//output results
	writeOutArg(ostream,"text");
	writeChar2D<20,81>(ostream,text,count);
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//29mod8
int _test_64dd0_distanceBeetwenPhrases(FILE *istream, FILE *ostream)
{
	char text[20][81], phrase1[41], phrase2[41];
	int count, result;
	//input data
	CHECK_ARG_NAME("text","distanceBeetwenPhrases");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("count","distanceBeetwenPhrases");
	count=readInt(istream);
	CHECK_ARG_NAME("phrase1","distanceBeetwenPhrases");
	readString(istream,phrase1,41);
	CHECK_ARG_NAME("phrase2","distanceBeetwenPhrases");
	readString(istream,phrase2,41);

	//execute test
	GUARD_CALL(result=_64dd0_distanceBeetwenPhrases(text,count,phrase1,phrase2))

	//check results for integrity
	CHECK_INT_LIMITS(result,0,1600,_ERROR_WRONG_RETURN_VALUE,"returned","distanceBeetwenPhrases","0","1600");
	//output results
	writeOutArg(ostream,"return");
	writeInt(ostream,result);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

//////////////////////////////Variant 30///////////////////////////////////////////////////////////////////////////
int _test_30_censorWords(FILE *istream, FILE *ostream)
{
	char str[81], word[21];
	//input data
	CHECK_ARG_NAME("str","censorWords");
	readString(istream,str,81);
	CHECK_ARG_NAME("word","censorWords");
	readString(istream,word,21);

	//execute test
	GUARD_CALL(_30_censorWords(str,word))

	//check results for integrity
	ENSURE_END_OF_STRING(str,81,"str","censorWords");
	//output results
	writeOutArg(ostream,"str");
	writeString(ostream,str);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}
//30mod6
int _test_5d510_censorText(FILE *istream, FILE *ostream)
{
	char text[20][81], word[81];
	int count;
	//actual size and name of word depends on report of 1'st variant: 6 - 20 characters, 7 - 40, 8 - 80
	char *tmpstr=getenv("reportnumber");
	int report=atoi(tmpstr);
	int str_size=21;
	if(report==7)
		str_size=41;
	else if(report==8)
		str_size=81;
	char str_name[30]="phrase";
	if(report==6)
		strcpy(str_name,"word");
	//input data
	CHECK_ARG_NAME("text","censorText");
	readChar2D<20,81>(istream,text);
	CHECK_ARG_NAME("count","censorText");
	count=readInt(istream);
	CHECK_ARG_NAME(str_name,"censorText");
	readString(istream,word,str_size);

	//execute test
	GUARD_CALL(_5d510_censorText(text,count,word))

	//check results for integrity
	ENSURE_END_OF_STRING_IN_TEXT(text,20,81,count,"text","censorText");
	//output results
	writeOutArg(ostream,"text");
	writeChar2D<20,81>(ostream,text,count);
	fprintf(ostream,"\n");
	return TESTRES_SUCCESS;
}

	//input data
	//execute test
	//check results for integrity
	//output results
